How to change location for default virtualhost?

marson

Verified User
Joined
Jan 30, 2012
Messages
60
Hello

I would like to change default virtualhost directory from /var/www/html to /home/parking/www, the reason for this is that I would like to give end user ability to put his website that will be shown if a particular domain ponts to his DNS but is not added to DirectAdmin yet. I changed the /var/www/html location in /usr/local/directadmin/custombuild/custom/ap2/conf/extra/httpd-vhosts.conf so it looks like this:

#
# Virtual Hosts
#
# Required modules: mod_log_config
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.4/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

##########################################################
# Use name-based virtual hosting. #
# All NameVirtualHost lines are in this file #
# Don't remove this line or apache will generate errors. #
##########################################################
Include /etc/httpd/conf/ips.conf

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost 1.2.3.4:80>
ServerAdmin webmaster@localhost
UserDir www
DocumentRoot /home/parking/www
ServerName localhost
ScriptAlias /cgi-bin/ /home/parking/cgi-bin/
CustomLog /var/log/httpd/homedir.log homedir
CustomLog /var/log/httpd/access_log combined
ErrorLog /var/log/httpd/error_log

<IfModule !mod_ruid2.c>
SuexecUserGroup parking parking
</IfModule>
</VirtualHost>

<VirtualHost 1.2.3.4:443>
ServerAdmin webmaster@localhost
UserDir www
DocumentRoot /home/parking/www
ServerName localhost
ScriptAlias /cgi-bin/ /home/parking/cgi-bin/
CustomLog /var/log/httpd/homedir.log homedir
CustomLog /var/log/httpd/access_log combined
ErrorLog /var/log/httpd/error_log

SSLEngine on
SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key
SSLCACertificateFile /etc/httpd/conf/ssl.crt/server.ca

<IfModule !mod_ruid2.c>
SuexecUserGroup parking parking
</IfModule>
</VirtualHost>
and then ./build rewrite_confs - the problem is that in the new location the PHP is not working, even simple <?php phpinfo(); ?> is not displayed, but pure html works from the new location, can you point me where I am doing something wrong?
 
Back
Top