linux下xampp(apache)中配置域名访问,以及遇到的问题
2016-12-18 20:48
786 查看
xampp中apache使用域名访问
一、首先找到/opt/lampp/etc/httpd.conf:
# Virtual hosts
Include etc/extra/httpd-vhosts.conf
去掉 Include etc/extra/http-vhosts.conf 前面的#号(以上我已经去掉)
二、修改 /opt/lampp/etc/extra/httpd-vhost.conf
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /opt/lampp/htdocs/b (这里写上所绑定到的目录)
ServerName www.linuxidc.com (这里写上域名)
ServerAlias www.dummy-host.example.com
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
如我的配置文件如下:
<VirtualHost *:80>
DocumentRoot "/opt/lampp/htdocs/"
ServerName dev.mansys.com
</VirtualHost>
三、修改 /etc/hosts ,添加
127.0.0.1 dev.mansys.com我的如下:
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
然后访问: dev.mansys.com 即可
如果出现以下错误:
Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
If you think this is 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
修改修改 /opt/lampp/etc/extra/httpd-vhost.conf ,修改后我的配置文件如下:
<VirtualHost *:80>
DocumentRoot "/opt/lampp/htdocs/"
ServerName dev.mansys.com
<Directory "/opt/lampp/htdocs/">
AllowOverride All
Order deny,allow
Allow from all
Require all granted
</Directory>
</VirtualHost>
再次访问,即可正常访问
一、首先找到/opt/lampp/etc/httpd.conf:
# Virtual hosts
Include etc/extra/httpd-vhosts.conf
去掉 Include etc/extra/http-vhosts.conf 前面的#号(以上我已经去掉)
二、修改 /opt/lampp/etc/extra/httpd-vhost.conf
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /opt/lampp/htdocs/b (这里写上所绑定到的目录)
ServerName www.linuxidc.com (这里写上域名)
ServerAlias www.dummy-host.example.com
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
如我的配置文件如下:
<VirtualHost *:80>
DocumentRoot "/opt/lampp/htdocs/"
ServerName dev.mansys.com
</VirtualHost>
三、修改 /etc/hosts ,添加
127.0.0.1 dev.mansys.com我的如下:
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
然后访问: dev.mansys.com 即可
如果出现以下错误:
Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
If you think this is 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
修改修改 /opt/lampp/etc/extra/httpd-vhost.conf ,修改后我的配置文件如下:
<VirtualHost *:80>
DocumentRoot "/opt/lampp/htdocs/"
ServerName dev.mansys.com
<Directory "/opt/lampp/htdocs/">
AllowOverride All
Order deny,allow
Allow from all
Require all granted
</Directory>
</VirtualHost>
再次访问,即可正常访问
相关文章推荐
- 配置arm-linux-gcc教程以及可能遇到的问题
- mac下配置Apache虚拟域名方案,以及遇到的坑
- 阿里云服务器linux环境,从启动tomcat服务器外网访问--->绑定域名--->Navicat远程连接mysql--->阿里云服务器部署项目过程中,一定会遇到的五大问题;
- Linux安装与配置samb服务器的过程以及遇到的问题
- Tomcat配置域名/IP访问及其中遇到的问题注意事项
- apache配置虚拟主机,为什么总是第一个VirtualHost起效 apache基于域名虚拟主机,只访问第一个的问题
- linux下配置apache虚拟主机解决方案以及一些问题
- linux Apache设置https访问以及加载mod_ssl.so模块以及问题解决
- 关于配置apache时无法用自定义域名访问论坛的问题
- MongoDB Replica Set的部署配置以及遇到的问题 linux
- apache 配置了虚拟域名访问受限问题
- Tomcat配置域名/IP访问及其中遇到的问题注意事项
- 在Linux(CentOS6.2)服务器上配置hadoop时遇到的一些问题以及一些解决办法
- apache配置虚拟主机,为什么总是第一个VirtualHost起效 apache基于域名虚拟主机,只访问第一个的问题
- apache配置虚拟主机,为什么总是第一个VirtualHost起效 apache基于域名虚拟主机,只访问第一个的问题
- XAMPP配置apache环境,用于运行rockmongo遇到的若干问题
- Linux下Apache配置局域网访问出现的问题
- Nginx在Linux下的安装与配置,以及遇到问题的解决整理
- Apache虚拟主机配置,实现多域名访问本地项目PHP空间,以及配置403Forbidden等错误的解决办法
- WIN7下.Net开发遇到的又一问题:HTTP 错误 500.19 - Internal Server Error,无法访问请求的页面,因为该页的相关配置数据无效。