ubuntu下apache2指定端口创建虚拟站点过程记录
2016-11-05 08:47
453 查看
ubuntu下apache2指定端口创建虚拟站点过程记录
最近做个网站,所以安装了apache2,网站必须在根目录下运行,所以只能在测试机器上指定端口创建虚拟站点。定端口创建虚拟站点过程如下:
打开终端安装apahce
sudo apt-get install apache2
转到配制目录
cd /etc/apache2
转到虚拟站点配制目录
cd sites-available/
拷贝默认站点
sudo cp 000-default.conf 你的文件名.conf
编辑文件
sudo gedit 你的文件名.conf
内容大致如下
<VirtualHost *:8082>
ServerAdmin webmaster@localhost
DocumentRoot 你的站点目录路径
<Directory 你的站点目录路经/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
Order deny,allow
Allow from all
Satisfy all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
说明:
DocumentRoot路径后不带/,Directory路径后带/
Allow from all必须有的
编辑上级目录中的端口配制文件
sudo gedit ../ports.conf
添加内容
Listen 8081
在上级目录sites-enabled中建立链接
sudo ln -s 你的文件名.conf ../sites-enabled/你的文件名.conf
重启apache
sudo /etc/init.d/apache2 restart
打开浏览器 http://127.0.0.1:8081/看一下成果吧
相关文章推荐
- linux vsftpd 创建虚拟用户 过程记录
- linux vsftpd 创建虚拟用户 过程记录
- Ubuntu 配置Apache2虚拟目录及对应端口
- Ubuntu下创建虚拟独立的Python环境全过程
- ubuntu非root用户创建网站时,修改apache2指定网站默认目录出现403
- linux vsftpd 创建虚拟用户 过程记录
- Ubuntu下Apache2 创建虚拟目录
- Ubuntu 10.04 内核2.6.34编译过程记录
- 在UBUNTU上安装Oracle 10g Express Edition过程记录
- 【翻译】使用IIS 7.0 PowerShell 创建web站点,Web应用,虚拟路径和应用程序池
- 在ubuntu下创建、编译并运行一个C++程序的过程
- 手动模仿Qt5创建GUI程序过程记录
- 在Windows下如何创建指定的虚拟环境
- ubuntu apache2配置详解(含虚拟主机配置方法)
- ubuntu apache2 端口的改变及apache2相关问题
- OpenCms创建站点过程图解——献给OpenCms的刚開始学习的人们
- 开放ubuntu server的指定端口
- 创建和关联内容数据库到指定Web应用程序和站点集
- wamp2.5 配置多端口多站点虚拟主机 新建站点
- ubuntu系统下如何配置虚拟主机与站点