Had a typo in open_basedir and now it cannot change back.

Discussion in 'General' started by MrCompTech, Mar 26, 2011.

  1. MrCompTech

    MrCompTech New Member

    Currently on ISPConfig3 version 3.0.3.2 on Fedora Core 13.

    Months ago while working on a different problem I changed the open_basedir path in ISPConfig3 for the web site but when I changed it back I had a typo in two of the paths adn didn't notice it until today.

    The open_basedir path with the typo:

    /var/www/clients/client1/web1/web:
    /var/www/clients/client1/web1/tmp:
    /var/www/mrcoptech.com/web:
    /srv/www/mrcoptech.com/web:
    /usr/share/php5:
    /tmp:
    /usr/share/phpmyadmin

    It should have been mrcomptech not mrcoptech:

    /var/www/clients/client1/web1/web:
    /var/www/clients/client1/web1/tmp:
    /var/www/mrcomptech.com/web:
    /srv/www/mrcomptech.com/web:
    /usr/share/php5:
    /tmp:
    /usr/share/phpmyadmin

    Even though I corrected the path in ISPConfig3, when I use the phpinfo() function the open_basedir paths still show with the typo. And in my Joomla admin panel 'Help' ==> 'System Info' also still shows the open_basedir path as incorrect as well. I looked in the ISPConfig3 database and it has the correct paths.

    When I found this problem I was troubleshooting a problem with no being able to ad a module to my Joomla web site and the web site error log revealed that the 'FcgidMaxRequestLen' was at the default file size. I made a change in ISPConfig3 for the web site () but the change does not take effect. Using phpinfo() still shows that 'FcgidMaxRequestLen' is still set to the default.

    I am guessing that the typo is causing the problem with the web site configuration changes in ISPConfig3 not taking effect.

    And every time a web page of the site is displayed about 6 to 10 errors are logged showing the incorrect path '/mrcoptech.com/'.

    Thanks for any help you may be able to provide.
     
  2. MrCompTech

    MrCompTech New Member

    A bit more Information...

    I created a phpinfo.php file for each web site on my ISPConfig3 server.

    Of the 4 web sites only mrcomptech.com shows any open_basedir paths.

    The remaining 3 web sites show the open_basedir as 'no value', despite the fact that all three have open_basedir paths set in their ISPConfig3 web site settings.

    All the docs I have looked at seem to indicate that there should be be directives in the web sites vhost file such as
    Code:
    "php_admin_value open_basedir {path}"
    , but there are none, in any of the web site vhosts files.

    In the /etc/php.ini file the open_basedir is commented out so what configuration file does ISPConfig3 use to enable open_basedir and what file is used to set the open_basedir paths for each web site?
     
  3. MrCompTech

    MrCompTech New Member

    And a bit more info...

    I tried running server.sh as root but all kinds of stuff scrolled up the screen, so much that I had to Ctrl-C to stop it. Tried capturing it to a file and got over 21 MB of stuff in about 2 seconds!

    Well the problem seemed to be that the settings in the database are not being implemented by the server.sh script.

    This small bit of output from server.sh indicates thsi as well:

    Code:
    26.03.2011-16:32 - DEBUG - There is already a lockfile set. Waiting another 10 seconds...
    
    26.03.2011-16:32 - WARNING - DB::query(INSERT INTO sys_log (server_id,datalog_id,loglevel,tstamp,message) VALUES ('1',0,'0','1301171523','There is already a lockfile set. Waiting another 10 seconds...')) -> mysql_query Table './dbispconfig/sys_log' is marked as crashed and should be repaired
    
    26.03.2011-16:32 - WARNING - DB::query(INSERT INTO sys_log (server_id,datalog_id,loglevel,tstamp,message) VALUES ('1',0,'1','1301171523','DB::query(INSERT INTO sys_log (server_id,datalog_id,loglevel,tstamp,message) VALUES (\'1\',0,\'0\',\'1301171523\',\'There is already a lockfile set. Waiting another 10 seconds...\')) -> mysql_query Table \'./dbispconfig/sys_log\' is marked as crashed and should be repaired')) -> mysql_query Table './dbispconfig/sys_log' is marked as crashed and should be repaired
    
    When I try an look at the table 'sys_log' in PHPMyAdmin it shows the table as "in use" and it cannot be viewed. When I click onthe structure icon in PHPMyAdmin I see the error message:

    "mysql said - #145 - Table './dbispconfig/sys_log' is marked as crashed and should be repaired"

    Any idea on how to repair this?
    I'm working on reading the MySQL docs now to figure this out, is there an easy way to fix this?
     
  4. MrCompTech

    MrCompTech New Member

    To fix the table table:

    1) stop the mysql server - /etc/init.d/mysqld stop
    2) to fix the table change to the directory for the database and run 'myisam {table name}' to check the table and then run 'myisamchk -r -q {table name}' to try a quick fix, if that doesn't work rerun the command and leave out the '-q'.

    This fixed the table but when trying to run server.sh I kept getting an error "DEBUG - There is already an instance of server.php running. Exiting." I manually deleted the lock file and rebooted the server.

    server.sh does seem to run normally now.

    Now running mrcomptech.com/phpinfo.php shows 'no value' for the open_basedir, which is the same as the other 3 sites onthis server, but I'm not sure if this is the way it should be. Seems like phpinfo() shoudl report the same paths that are specified in ISPConfig3 managment console for the web sites.

    Ok, well now all the settings in the ISPConfig3 console for the mrcomptech.com web site are now showing in the phpinfo() function output, but now there is a different problem!!!!

    Now when I run server.sh I see a warning for each web site on the server:

    [Sat Mar 26 19:04:01 2011] [warn] VirtualHost 192.168.1.10:80 overlaps with VirtualHost 192.168.1.10:80, the first has precedence, perhaps you need a NameVirtualHost directive

    And all my websites all go to the same web site, something else to fix!

    In ISPConfig3 tried changing the 'IP-Address' from the severs ip address to '*' but that didn't fix the problem.

    Then in the /etc/httpd/conf/site-available directory, for every web site, above the <virtualHost *:80> I added "NameVirtualHost *:80" and now all sites seem to be working.
     
    Last edited: Mar 27, 2011
  5. MrCompTech

    MrCompTech New Member

    I spoke too soon!

    After a couple of minutes which would be after cron ran server.sh all my sites point back to the same site and when I took a look at the *.vhost files every entry of NameVirtualHost *:80 that I had put into the files had been removed!

    So manual editing is not the fix.

    Does anyone know what is?
     
  6. MrCompTech

    MrCompTech New Member

    OK - The "NameVirtualHost *:80" had been commented out, not sure how that happened seeing as how I didn't even touch this file! I'm guessing that ISPConfig writes to it even though this seems like something that should not have been changed. guess I'll give it a little while and see if it gets commented out again.
     
  7. till

    till Super Moderator

    Thats the correct and intended behaviour. Never edit one of ispconfigs vhost files manually.

    The NameVirtualHost *:80 is a default of the Linux distribution andnot set or edited by ispconfig as it comes from the Linux distribution.
     
  8. MrCompTech

    MrCompTech New Member

    These sites had been up and running for sometime before I foudn the initial problem, so the NameVirtualHost *:80 at the bottom of the httpd.conf file had been there so I'm not really sure howthis got changed unless it was when, in ISPConfig3, I set all the web site "IP-Address' to "*" instead of the LAN P address of the server.
     
  9. till

    till Super Moderator

    ISPConfig is not editing the httpd.conf file. But you explained already the reason for your problems, you changesd the website settings from IP to * and as your system has no namevirtualhost for * defined, the websites were not reachable anymore.
     

Share This Page