step by step入门LAMP配置
来源:互联网 发布:橙光立绘制作软件 编辑:程序博客网 时间:2024/05/06 03:18
安装apache2参见《step by step学习LAMP配置》一文。
环境:
虚拟机上安装的debian系统
apache2
python2.6
mysql5.5
一、入门:搭建一个简单的网页“Welcome to my blog~”
该部分介绍如何在apache上搭建一个简单web应用,会搭建两个虚拟机,分别对应不同的port,共享一个ip。
1.编写虚拟机配置文件
cp /etc/apache2/sites-avaliable/default /etc/apache2/sites-avaliable/blog.mytest.com
cp /etc/apache2/sites-avaliable/default /etc/apache2/sites-avaliable/cici.com
default文件是apache自带的虚拟机配置文件,因此这里不用自己编写,拷贝两份修改就ok了~
2.编辑虚拟机配置文件
vim /etc/apache2/sites-avaliable/blog.mytest.com
修改 <VirtualHost *:80>为 <VirtualHost *:8080>
DocumentRoot改为需要将网页源文件保持的路径:eg:DocumentRoot /home/cici/www/blog.mytest.com/
修改相应的: <Directory /home/cici/www/blog.mytest.com/>
然后vim /etc/apache2/sites-avaliable/cici.com做类似的修改,但是该虚拟机的port设置为8081,路径也需要更改为期望指定的路径
3.执行
ln -s /etc/apache2/sites-avaliable/blog.mytest.com /etc/apache2/sites-enabled/blog.mytest.com
ln -s /etc/apache2/sites-avaliable/cici.com /etc/apache2/sites-enabled/cici.com
在sites-available里面的文件是有效的虚拟主机配置,只要将其连接到site-enabled目录下才能真正生效;
4.执行
vim /etc/apache2/httpd.conf
添加语句ServerName localhost
5.执行vim /etc/apache2/ports.conf配置server的监听端口
添加Listen 8080和Listen 8081
6.执行service apache 2 restart
7.在/home/cici/www/blog.mytest.com/目录下创建一个index.html文件
<h1>Welcome to my blog~</h1>
8.在可以互相通讯的client上,用浏览器访问server_ip:8080,就能看到页面打印出“Welcome to my blog~”信息了~!
环境:
虚拟机上安装的debian系统
apache2
python2.6
mysql5.5
一、入门:搭建一个简单的网页“Welcome to my blog~”
该部分介绍如何在apache上搭建一个简单web应用,会搭建两个虚拟机,分别对应不同的port,共享一个ip。
1.编写虚拟机配置文件
cp /etc/apache2/sites-avaliable/default /etc/apache2/sites-avaliable/blog.mytest.com
cp /etc/apache2/sites-avaliable/default /etc/apache2/sites-avaliable/cici.com
default文件是apache自带的虚拟机配置文件,因此这里不用自己编写,拷贝两份修改就ok了~
2.编辑虚拟机配置文件
vim /etc/apache2/sites-avaliable/blog.mytest.com
修改 <VirtualHost *:80>为 <VirtualHost *:8080>
DocumentRoot改为需要将网页源文件保持的路径:eg:DocumentRoot /home/cici/www/blog.mytest.com/
修改相应的: <Directory /home/cici/www/blog.mytest.com/>
然后vim /etc/apache2/sites-avaliable/cici.com做类似的修改,但是该虚拟机的port设置为8081,路径也需要更改为期望指定的路径
3.执行
ln -s /etc/apache2/sites-avaliable/blog.mytest.com /etc/apache2/sites-enabled/blog.mytest.com
ln -s /etc/apache2/sites-avaliable/cici.com /etc/apache2/sites-enabled/cici.com
在sites-available里面的文件是有效的虚拟主机配置,只要将其连接到site-enabled目录下才能真正生效;
4.执行
vim /etc/apache2/httpd.conf
添加语句ServerName localhost
5.执行vim /etc/apache2/ports.conf配置server的监听端口
添加Listen 8080和Listen 8081
6.执行service apache 2 restart
7.在/home/cici/www/blog.mytest.com/目录下创建一个index.html文件
<h1>Welcome to my blog~</h1>
8.在可以互相通讯的client上,用浏览器访问server_ip:8080,就能看到页面打印出“Welcome to my blog~”信息了~!
9.此外可以用a2ensite cici.com或是a2dissite cici.com激活或是注销某个虚拟机。
- step by step入门LAMP配置
- step by step学习LAMP配置
- Dataguard配置Step by Step
- cetia4入门step by step(1)
- Mantis平台Step-By-Step配置手册
- Oracle dataguard配置Step by Step
- josso for tomcat配置 step by step
- MySQL Cluster配置step by step
- step by step 配置mysql复制
- Step by Step 配置dubbo服务
- VIM配置Step By Step-----NERDTree篇
- VIM配置Step By Step------Vundle篇
- VIM 配置Step By Step------完整篇
- Bitnami Gitlab 安装配置 step by step
- SSH2 Step by Step- Step 1 Struts2初步配置学习
- SSH2 Step by Step- Step 2 Hibernate的配置
- SSH2 Step by Step- Step 1 Struts2初步配置学习
- NHibernate Step by Step
- Linux-Load Average解析
- OpenGL画简单图形
- 容器
- 移植u-boot1.1.4支持操作nandFlash的nand erase命令
- Java编程中“为了性能”需做的26件事
- step by step入门LAMP配置
- matlab科学计算常用函数
- linux-0.11调试教程 minix文件系统1.0 下篇(2)inode_table内存i节点表和目录 /etc/tty0
- 登录验证数据库建立及数据库学习总结
- SystemUI之:Notification前世今生
- debian命令集(三)
- 微信摇一摇功能代码解析
- 课后总结:1.1_编程及java基础常识
- 文件系统:FAT(FAT16),FAT32,VFAT,NTFS