XAMPP Apache uses domain name access
First, find/opt/lampp/etc/httpd.conf:
# Virtual hosts
Include etc/extra/httpd-vhosts.conf
Remove the # number in front of the Include etc/extra/http-vhosts.conf (I've removed the above)
Ii. Modification of/opt/lampp/etc/extra/httpd-vhost.conf
<virtualhost *:80>
ServerAdmin webmaster@dummy-host.example.com
documentroot/opt/lampp/htdocs/b (the directory to which the binding is written)
ServerName www.linuxidc.com (write the domain name here)
Serveralias www.dummy-host.example.com
ErrorLog logs/ Dummy-host.example.com-error_log
customlog logs/dummy-host.example.com-access_log Common
</ Virtualhost>
If my profile is as follows:
<virtualhost *:80>
documentroot "/opt/lampp/htdocs/"
ServerName dev.mansys.com
Virtualhost>
Third, modify/etc/hosts, add
127.0.0.1 dev.mansys.com
I have the following:
127.0.0.1 localhost
127.0.0.1 dummy-host.example.com
127.0.0.1
dev.example.com 127.0.0.1 dev.mansys.com
Then visit: dev.mansys.com can
If the following error occurs:
Object not found!
The requested URL is not found to this server. If you are entered the URL manually please check your spelling and try again.
If you would be a server error, please contact the webmaster.
Error 404
Dummy-host.example.com
apache/2.4.23 (Unix) openssl/1.0.2h php/5.5.38 Mod_perl/2.0.8-dev perl/v5.16.3
Modify the/opt/lampp/etc/extra/httpd-vhost.conf, modify my configuration file as follows:
<virtualhost *:80>
documentroot "/opt/lampp/htdocs/" ServerName dev.mansys.com
" opt/lampp/htdocs/">
allowoverride All order
Deny,allow
allow to Require all
granted
</Directory>
</VirtualHost>
Access again to normal access