Jump to content

the_oliver

Members
  • Posts

    364
  • Joined

  • Last visited

    Never

Posts posted by the_oliver

  1. Hello,

    Looking for some advice please.  Whilst i can do this in PostgreSQL im not sure weather it is the same for MySQL.  Im looking for a way to create a user and a database, assigning only the new user permisions to use it.  I want all this to happen automaticaly from a php script.  Can i just run it as a query from a user with the wright permisions?

    Also is there a way that i can monitor/restrict the size of a database?

    Thanks.
  2. Thanks for all of that!  So there is no way to run a .asp sccript on an OS other then windows?  What is the diffrence between ASP and ASP.NET?  Which is the one you have to pay for?

    (Thanks for all your comments).
  3. Hi,

    Whilst i am a php person i have been meeting more people resently who always insist on .asp and noticing more large sites using it.  Is there a resion for this?  Is it better for server side stuff?  I know nothing about it so thought id see if someone can fill me in!

    Ta!
  4. Thanks, it would make life simpler, but i need to do it this way really.  Its something that i dont just use in .php scrips so would like to know what im doing wrong for others also.  + the scrip is running on windows files.
  5. Hello,
    I have a scrip which will copy a file only if one is newer then the other.  To do this i work out its age wateing years more then months, months more than days . . . etc.  It was working fine in 2006, but now in 2007 it thinks that the old script is newer.  I know that i need to change the waiting, but my maths is not quite up to this!

    So at the moment it is basicly:
    [code]$ModDate1 = Year * 10000 + Month * 1000 + Day * 100 + Hour * 10 + Minute[/code]

    Can anyone tell me what to do to solve this?

    Thanks!
  6. Rairly any need to restart an entire server!  Can just reboot parts of it.  And being open source you can do as you please!

    Check out http://www.centos.org
  7. Hello.  Im running the folloging code and its not doing quite what i want.  When i run a command through the shell_exec() function i want to decide what happens next, based on whethe anything was returned.  Eg, if the code is to create a file, and it works, there should be no responce, and thus i want to carry on, after deleting the database row.  However if something is retured, (for example, 'directory already exists') then i want it it update the database and break;

    The problem is it alway reacts as if nothing has been returned.  Can anyone help?

    [code]foreach($c as $value)
    {
    $return = shell_exec($value);

    if ($return == "")
    {
    $remove = "DELETE FROM table WHERE id LIKE $id";
                    pg_query($pg_connection, $remove);
    }
    Else
    {
    $error_report = "UPDATE table SET error = 'Error: ".$return."' WHERE id = '".$id."'";
    break;
    }
    }[/code]


    - Thanks
  8. Sounds intresting!  I also use php for similar resions!

    Anyway..... The easyest way would be to add it to /etc/rc.local .  It can also be added to /etc/inittab.  The main diffrence hear is that anything in rc.local is run after everything in init.  If your script is reliant on other services this feature of the rc.local file may be usfull.

    The other option is to make it a standard init script.  This will then run as a service, and you can controle its run level like any other.  If you wish to go down this way it would be best to read up on chkconfig and things!  i dont really know/remember enough to help you hear.  In some situations this is prefrable for odvious resions, but some of the experts say it also makes the script more visible. (that a little above me!).  I asume its if your going to be calling them from else where.

    Hope some of this is helpfull.
  9. Hello, im have the following in a php script, which cron runs every now and then!

    [code]$c1 = "useradd ".$username." -p $(crypt ".$clearpass.")";
    shell_exec('$c1');[/code]

    Everything else in the script works fine, except this which returns this error to me by mail:

    [quote]X-Cron-Env: <SHELL=/bin/sh>
    X-Cron-Env: <HOME=/root>
    X-Cron-Env: <PATH=/usr/bin:/bin>
    X-Cron-Env: <LOGNAME=root>
    X-Cron-Env: <USER=root>

    sh: useradd: command not found[/quote]

    Can anyone tell me where i have gone wrong?  if i run useradd laura -p $(crypt laurahelm) in the comand prompt it works fine.

    Thanks

    (im running it on CentOS 4.4)
  10. why are you using ns1 and ns2 to point to an apache server?  These would inply they are the DNS server for this domin?  If you are running the dedicated server as you DNS server having them both point to the same box compleatly defies the point.  Are you just trying to set up a web server, with works on whatever.com?

    You really have given us nothing clear to go on.

    Also using test.com with our a pretext to it (say www. or ns1. or whatever.) requires a diffrent type of record.  (i asume you have writen a standard A-record for the others). Where are these host records?  If you need a change to the whois poll then the ns servers need to be changed by the registra, or owner is purchaced direct from a TLD.
  11. It is possible to have a script run at start-up or shutdown.  In this case it may be worth making this a seprate script that prompts your main script.  How you do this depends very much on what distro you are running.  Havent done this for a while but i seem to remember placing the script in /etc/init.d and then running somthing like "rc-update add <script> default".  Idealy you want to define it as a service. 

    By far the simplest way to do it however would be to add it as a cron task.  If cron's not an option, let us know your linux distro and perhaps we can tell you more.
  12. [quote]recipients ID is in the TO field so anything TO id's that match theirs are displayed[/quote]

    When the recipiects search for rows with ID's matching there could they also look for anyrow with the letter A in the to field?  or a second unique number that all users look for? + add a line into the script for there PM page stopping the PM from being deleted?
  13. Hello.

    I have virtual hosts set up with the following on an apache server, running CentOS 4.4.

    [code]
    # get the server name from the Host: header
    UseCanonicalName Off

    # this log format can be split per-virtual-host based on the first field
    LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon
    CustomLog logs/access_log vcommon

    # include the server name in the filenames used to satisfy requests
    VirtualDocumentRoot /var/www/html/%0/docs
    VirtualScriptAlias  /var/www/html/%0/cgi-bin

    [/code]
    This works well, however i want the DocumentRoot to be on a diffrent partition, with the mount point /www
    Partition is fine however when i change the code to this:


    [code]# include the server name in the filenames used to satisfy requests
    VirtualDocumentRoot /www/%0/docs
    VirtualScriptAlias  /www/%0/cgi-bin[/code]

    there is a problem! The web browser always shows:


    [quote]Forbidden
    You don't have permission to access / on this server.
    Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

    [/quote]Can anyone tell me where im going wrong???? - Thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.