how to change the default web directory "/var/www"

Discussion in 'General' started by junmin, Aug 20, 2007.

  1. junmin

    junmin New Member

    hi, i have been running ispconfig for about a month...
    but i got a problema now, when i was installing ispconfig, i was thinking that the user's web directories will be /home/, so i give /home the biggest partition!.... so i have to change the default web directory /var/www now...

    how can i change it??

    i was thinking that,

    move all the content of /var/www to a temp directory
    creat a directory named www at /home
    move all the content of the temp directory to /home/www
    remove the /var/www directoy and then
    ln -s /var/www /home/www/
    is it OK? will it cause any problem?? thanks.
    Last edited: Aug 20, 2007
  2. till

    till Super Moderator

    I recommend the following procedure.

    1) the httpd, postfix, pop3,imap and ispconfig service.
    2) Move /var/www to /home/www
    3) Symlink /var/www to /home/www
    4) start ISPConfig:

    /etc/init.d/ispconfig_server start

    and change the document root under management > server > settings on the web tab.

    then execute the following sql statement in the database to update all websites:

    update isp_isp_web set status = 'u' where status = '';

    Now wait a few minutes until ISPConfig has changed the website config for all sites and start http, pop3, imap and mail daemon again.
  3. jmroth

    jmroth ISPConfig Developer

    Hmmm... I was trying to change the document root in the web interface for a similar reason, but it did not use the new one I specified, and displayed and used the old one again.
    So I changed the document root in the database directly too.
  4. till

    till Super Moderator

    As you installed your ISPConfig version, did you import the SQL dump manually?
  5. jmroth

    jmroth ISPConfig Developer

    Oh I really don't remember because I'm using it for a long time now. :)

    Anyway, I was just thinking people might not often change their root directory, so maybe a bug has appeared in that piece of code at some time, and went unnoticed so far.
  6. till

    till Super Moderator

    The problem that you described is normally caused by inserting the sql dump manually during installation as ISPConfig will not be able to save or read any config settings from the management > server settings part.
  7. jmroth

    jmroth ISPConfig Developer

    So what exactly is the difference when I insert it manually?
    Doesn't the ISPconfig installation routine just do a "mysql ... < dump.sql" or alike? :confused:
  8. till

    till Super Moderator

    Your installation is incomplete and all server variables are set to defaults and not to the correct values for your system.

    No, the ISPConfig installer creates records dynamically based on your server configuration. These records are not in the SQL dump.
  9. jmroth

    jmroth ISPConfig Developer

    How can I actually find out if I imported the SQL dump or let the installer create the stuff?

    What should be missing?
  10. till

    till Super Moderator

    Check if you have a record in the table isp_isp_server with doc_id = 1.
  11. jmroth

    jmroth ISPConfig Developer

    Yes I do (have a table called isp_server) :)

    That is where I manually changed the new home directory in the server_path_httpd_root field because the UI wouldn't let me.
  12. till

    till Super Moderator

    This table is always present, even if you imported it manually. The question is if this table has just one record inside which has the doc_id = 1
  13. jmroth

    jmroth ISPConfig Developer

    Yep it does only contain this one record.

    Is that good or bad? :)
  14. till

    till Super Moderator

    And the doc_id field of this record is 1 or not? If it doc_id = 1, it is ok, if doc_id > 1 its not ok.
  15. jmroth

    jmroth ISPConfig Developer

    Yeah it is = 1 .
    I tried changing it again, and this time it worked. (using the UI)
    Oh well thanks anyway!
  16. Camran

    Camran New Member

    how to change on web directory

    it is how to change a web directory location. i couldnt change the subject.)

    If for example /var/www has no space to create more web site and for example i add new hard disk and mount it as /wwwdata then i want to create a new web site but not in /var/www because it has no space, instead in /wwwdata what is the best way you think?

    i used ln -s to point web3 to /wwwdata/web3 and to /wwwdata/web3

    Thanks for your reply..
    Last edited: Nov 12, 2008
  17. falko

    falko Super Moderator

    Are you using LVM? Then you can extend your LVM partitions.
  18. Camran

    Camran New Member

    i dont want to use this way instead as i have /wwwdata which is my new harddisk i thought it is better (because of space limitation) to move /var/www/web3 to /www/web3 and using ln -s , now i want to know is it good way or i have another choise?

    thanks for your attention,
  19. falko

    falko Super Moderator

    Yes, you can do that.

Share This Page