Problems with path to document root and username
Hello all,
I am setting up a new server (RHEL3) with current GPL copies of Webmin and Virtualmin, been wrestling with this for about a week. At present I am trying to work out how to change the path to the document root and a few related things.
I have several sites with custom developed (read sloppy programming) php and perl applications. And I would like to match the old environment in terms of path names so I don't have to hunt through 1300 plus files to change hard coded path names.
These programs were developed for separate document roots to hold files to be accessed by http and https as follows.
/home/httpd/vhosts/example.com/httpdocs
and
/home/httpd/vhosts/example.com/httpsdocs
I tried modifying several fields in Virtualmin's Default Server Template, but it appeared that Virtualmin had problems with the path to access_log:
Apache website failed! :
Failed to open /home/httpd/vhosts/example.com/logs/access_log for writing : No such file or directory at ../web-lib-funcs.pl line 789.
This error makes perfect sense, as the actual directory structure did not match.
/home/{username}/httpd/vhosts/example.com/httpdocs
Here's what I changed in Virtualmin
From Webmin/Servers/Virtualmin Virtual Servers/Server Templates
Click Default Settings, under Name and change the following:
Write logs via program? (Handles missing log directory) - Yes
Root directory in file chooser: change ${HOME} to /home/httpd/vhosts/${DOM}
Directives and settings for new websites - Change the following:
=== Original
ServerName ${DOM}
ServerAlias www.${DOM}
DocumentRoot ${HOME}/public_html
ErrorLog ${HOME}/logs/error_log
CustomLog ${HOME}/logs/access_log common
ScriptAlias /cgi-bin/ ${HOME}/cgi-bin/
[Directory ${HOME}/public_html>
Options Indexes IncludesNOEXEC FollowSymLinks
allow from all
[/Directory>
=== Change ${HOME} to /home/httpd/vhosts/${DOM}
=== Change /public_html to /httpdocs
=== Modified
ServerName ${DOM}
ServerAlias www.${DOM}
DocumentRoot /home/httpd/vhosts/${DOM}/httpdocs
ErrorLog /home/httpd/vhosts${DOM}/logs/error_log
CustomLog /home/httpd/vhosts/${DOM}/logs/access_log common
ScriptAlias /cgi-bin/ /home/httpd/vhosts/${DOM}/cgi-bin/
[Directory /home/httpd/vhosts/${DOM}/httpdocs>
Options Indexes IncludesNOEXEC FollowSymLinks
allow from all
[/Directory>
Users' website subdirectory to create - Directory under home - httpd/vhosts/${DOM}/httpdocs
Subdirectory for Webalizer statistics - Directory under home - httpd/vhosts/${DOM}/httpdocs/stats
After getting the error above a few times, I changed everything back as it was, but the error, or maybe one similar, persisted. After much hair pulling, an uninstall of Webmin and deleting it's directories and restoring a backup still did not correct the error, I finally looked into httpd.conf and found eight (!) entries for the example.com domain. After deleting these, things returned to normal.
=============================
Observations and questions:
Assuming the default site template as provided in Virtualmin, how can I create a virtual host with the following path/name:
Path: /home/example.com/public_html linux user: frodo
====== Examples ======
In the Create Virtual Server page: If Administration User (Custom) is specified as frodo, and the domain example.com ...
Path: /home/frodo/public_html linux user: frodo
OR
In the Create Virtual Server page: If Administration User (Custom) is specified as example.com, and the domain example.com ...
Path: /home/example.com/public_html linux user: example.com
OR
In the Create Virtual Server page: If Administration User (Automatic), and the domain example.com ...
Path: /home/example/public_html linux user: example
This close, but not quite.
Path: /home/httpd/vhosts/example.com/httpdocs linux user: frodo
Am I going about this wrong?
Is there a way to have non-ssl protected pages in public_html and ssl protected pages in another document root such as secure_html?
a. Is there a way to create a site that does not have the {username} in the path?
e.g. /home/httpd/vhosts/example.com/httpdocs Not /home/{username}/httpd/vhosts/example.com/httpdocs
b. Am I likely to cause a problem for Virtualmin by editing configuration files and changing the Linux file system (name owner, etc.)?
c. What else, besides Apache and Webalizer, will be affected by the document root path and linux user/site owner changes?
d. Is there built-in support for an ssl site with separate document root for ssl protected files?
e. And assuming that my problems are not just the result of my own ignorance, will this degree of customization be better handled in the soon-to-be-released Virtualmin pro?
Thanks for your attention, I know I have asked a lot here.
Best,
-Glen
dup removed
I too would like to know if "Is there built-in support for an ssl site with separate document root for ssl protected files?"
thanks