Httpd. conf setting in apache2.4.6 & nbsp; recently, I was learning to use apache2.4.6. However, I am worried that I don't know how to set my own virtual directory. The method set in apache2.2 does not work in 2.4.6. please kindly advise !!!!! Httpd. conf setting in apache2.4.6
Recently, I was learning to use apache2.4.6. However, I am worried that I don't know how to set my own virtual directory. The method set in apache2.2 does not work in 2.4.6. please kindly advise !!!!!
Share:
------ Solution --------------------
This sentence is written in htto. conf.
Include conf/local-vhosts.conf
Then create a file in the same directory named local-vhosts.conf, maybe apache already has one, renamed
Write the following things in it, modify them according to your actual situation, and save and restart apache.
# Port customization
ServerAdmin xxx@mail.com
DocumentRoot "absolute path"
ServerName localadm
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common
ServerAdmin email
DocumentRoot "absolute path"
ServerName localadm
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common
The configuration should be generic. if the configuration fails after upgrade, Some statements may conflict with each other. view the apache logs
------ Solution --------------------
Listen 8891.
NameVirtualHost *: 8891 # the port number you want to set
ServerAdmin admin @ localhost
DocumentRoot "e:/xiangmu/xiangmu1" # The location where your source code is to be stored. do not use the Chinese path.
ServerName 192.168.111.111: 8891 # Your local ip address + port number
Options Indexes FollowSymLinks
AllowOverride all
Order Deny, Allow
Deny from all
Allow from 127.0.0.1
Allow from 127.0.0.1
Allow from 192.168.111.111 # Your local ip address