linux部署项目方法1
2017-01-16 19:02
218 查看
远程登录
ssh -p 5108 root@52.**.173.202
The authenticity of host '[52.215.173.202]:5108 ([52.215.173.202]:5108)' can't be established.
RSA key fingerprint is 88:f9:c9:d7:65:29:65:3c:41:c1:50:74:7b:14:74:ce.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[52.215.173.202]:5108' (RSA) to the list of known hosts.
root@52.215.173.202's password: ******
Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-23-generic x86_64)
* Documentation: https://help.ubuntu.com/
Last login: Tue Apr 23 17:37:14 2013 from 180.172.53.43
root@SNDA-192-168-15-106:~# pwd
/root
root@SNDA-192-168-15-106:~# cd /etc/apache2/sites-available
复制一份
root@SNDA-192-168-15-106:/etc/apache2/sites-available# cp default yoursite.com
root@SNDA-192-168-15-106:/etc/apache2/sites-available# ls
default default-ssl yoursite_com
root@SNDA-192-168-15-106:/etc/apache2#cd sites-enabled/
root@SNDA-192-168-15-106:/etc/apache2/sites-enabled# ls
000-default
创建链接
root@SNDA-192-168-15-106:/etc/apache2/sites-enabled#ln -s ../sites-available/yoursite_com
.
root@SNDA-192-168-15-106:/etc/apache2/sites-enabled# ll
total 8
drwxr-xr-x 2 root root 4096 Apr 25 11:09 ./
drwxr-xr-x 7 root root 4096 Apr 3 19:50 ../
lrwxrwxrwx 1 root root 26 Apr 1 18:10 000-default -> ../sites-available/default
lrwxrwxrwx 1 root root 31 Apr 25 11:09 yoursite_com -> ../sites-available/yoursite_com
root@SNDA-192-168-15-106:/etc/apache2/sites-available# ls
default default-ssl yoursite_com
传送文件和部署
这个P 一定要大写
root@root-M68MT-S2P:/var/www$scp -P 5108 project_20130425.tar.gz root@52.215.173.202:/root/
root@52.215.173.202's password:******
project_20130425.tar.gz 100% 912KB 911.9KB/s 00:00
压缩后再传送
root@root-M68MT-S2P:/var/www$ cpproject_20130425.sql
/tmp/
root@root-M68MT-S2P:/var/www$ cd /tmp/
root@root-M68MT-S2P:/tmp$ tar czfproject_20130425.sql.tgzproject_20130425.sql
root@root-M68MT-S2P:/var/www$scp -P 5108 /tmp/project_20130425.sql.tgz
root@52.215.173.202:/root/
root@52.215.173.202's password:
project_20130425.sql.tgz 100% 666KB 666.5KB/s 00:00
root@root-M68MT-S2P:/var/www$
编辑 yoursite_com
1 <VirtualHost *:80>
2 ServerName yoursite.com
3 ServerAlias www.yoursite.com
4 ServerAdmin webmaster@localhost
5
6 Redirect /dian /cc?login=cc
7 Redirect /wen /cc?login=pp
8 ProxyPass /cc http://localhost:9088
9
10 DocumentRoot /var/www/drupal/
11 <Directory />
12 Options FollowSymLinks
13 AllowOverride All
14 </Directory>
15 <Directory /var/www/drupal/>
16 Options Indexes FollowSymLinks MultiViews
17 AllowOverride All
18 Order allow,deny
19 allow from all
20 </Directory>
21
22 ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
23 <Directory "/usr/lib/cgi-bin">
24 AllowOverride All
25 Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
26 Order allow,deny
27 Allow from all
28 </Directory>
29
30 ErrorLog ${APACHE_LOG_DIR}/error.log
31
32 # Possible values include: debug, info, notice, warn, error, crit,
33 # alert, emerg.
34 LogLevel warn
35
36 CustomLog ${APACHE_LOG_DIR}/access.log combined
37
38 Alias /doc/ "/usr/share/doc/"
39 <Directory "/usr/share/doc/">
40 Options Indexes MultiViews FollowSymLinks
41 AllowOverride All
42 Order deny,allow
43 Deny from all
44 Allow from 127.0.0.0/255.0.0.0 ::1/128
45 </Directory>
46
47 </VirtualHost>
ssh -p 5108 root@52.**.173.202
The authenticity of host '[52.215.173.202]:5108 ([52.215.173.202]:5108)' can't be established.
RSA key fingerprint is 88:f9:c9:d7:65:29:65:3c:41:c1:50:74:7b:14:74:ce.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[52.215.173.202]:5108' (RSA) to the list of known hosts.
root@52.215.173.202's password: ******
Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-23-generic x86_64)
* Documentation: https://help.ubuntu.com/
Last login: Tue Apr 23 17:37:14 2013 from 180.172.53.43
root@SNDA-192-168-15-106:~# pwd
/root
root@SNDA-192-168-15-106:~# cd /etc/apache2/sites-available
复制一份
root@SNDA-192-168-15-106:/etc/apache2/sites-available# cp default yoursite.com
root@SNDA-192-168-15-106:/etc/apache2/sites-available# ls
default default-ssl yoursite_com
root@SNDA-192-168-15-106:/etc/apache2#cd sites-enabled/
root@SNDA-192-168-15-106:/etc/apache2/sites-enabled# ls
000-default
创建链接
root@SNDA-192-168-15-106:/etc/apache2/sites-enabled#ln -s ../sites-available/yoursite_com
.
root@SNDA-192-168-15-106:/etc/apache2/sites-enabled# ll
total 8
drwxr-xr-x 2 root root 4096 Apr 25 11:09 ./
drwxr-xr-x 7 root root 4096 Apr 3 19:50 ../
lrwxrwxrwx 1 root root 26 Apr 1 18:10 000-default -> ../sites-available/default
lrwxrwxrwx 1 root root 31 Apr 25 11:09 yoursite_com -> ../sites-available/yoursite_com
root@SNDA-192-168-15-106:/etc/apache2/sites-available# ls
default default-ssl yoursite_com
传送文件和部署
这个P 一定要大写
root@root-M68MT-S2P:/var/www$scp -P 5108 project_20130425.tar.gz root@52.215.173.202:/root/
root@52.215.173.202's password:******
project_20130425.tar.gz 100% 912KB 911.9KB/s 00:00
压缩后再传送
root@root-M68MT-S2P:/var/www$ cpproject_20130425.sql
/tmp/
root@root-M68MT-S2P:/var/www$ cd /tmp/
root@root-M68MT-S2P:/tmp$ tar czfproject_20130425.sql.tgzproject_20130425.sql
root@root-M68MT-S2P:/var/www$scp -P 5108 /tmp/project_20130425.sql.tgz
root@52.215.173.202:/root/
root@52.215.173.202's password:
project_20130425.sql.tgz 100% 666KB 666.5KB/s 00:00
root@root-M68MT-S2P:/var/www$
编辑 yoursite_com
1 <VirtualHost *:80>
2 ServerName yoursite.com
3 ServerAlias www.yoursite.com
4 ServerAdmin webmaster@localhost
5
6 Redirect /dian /cc?login=cc
7 Redirect /wen /cc?login=pp
8 ProxyPass /cc http://localhost:9088
9
10 DocumentRoot /var/www/drupal/
11 <Directory />
12 Options FollowSymLinks
13 AllowOverride All
14 </Directory>
15 <Directory /var/www/drupal/>
16 Options Indexes FollowSymLinks MultiViews
17 AllowOverride All
18 Order allow,deny
19 allow from all
20 </Directory>
21
22 ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
23 <Directory "/usr/lib/cgi-bin">
24 AllowOverride All
25 Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
26 Order allow,deny
27 Allow from all
28 </Directory>
29
30 ErrorLog ${APACHE_LOG_DIR}/error.log
31
32 # Possible values include: debug, info, notice, warn, error, crit,
33 # alert, emerg.
34 LogLevel warn
35
36 CustomLog ${APACHE_LOG_DIR}/access.log combined
37
38 Alias /doc/ "/usr/share/doc/"
39 <Directory "/usr/share/doc/">
40 Options Indexes MultiViews FollowSymLinks
41 AllowOverride All
42 Order deny,allow
43 Deny from all
44 Allow from 127.0.0.0/255.0.0.0 ::1/128
45 </Directory>
46
47 </VirtualHost>
相关文章推荐
- linux服务器下部署项目修改配置使请求路径前自动加上项目名称 附 直接请求ip访问方法
- 自写聊天室_LinuxC实现(1)——项目部署遇到问题及解决方法
- Linux下部署springboot项目的方法步骤
- tomcat中三种部署项目的方法
- J2EE项目在LINUX环境下的部署:五、容器TOMCAT的安装
- linux下安装java需要的应用程序,并部署项目
- tomcat中三种部署项目的方法
- 在tomcat中三种部署项目的方法
- Web项目的类库中引用WebService,在部署后动态配置WebService路径的方法
- J2EE项目在LINUX环境下的部署:四、ORACLE的安装
- (求助 大拿们)linux下自动部署jsp项目
- J2EE项目在LINUX环境下的部署:四、ORACLE的安装
- 在web项目中的类库中引用webservice 在部署后更改webservice路径的方法
- J2EE项目在LINUX环境下的部署:五、容器TOMCAT的安装
- 项目部署不到tomcat中的原因和解决方法
- J2EE项目在LINUX环境下的部署:一、LINUX 安装
- Linux下部署项目时碰到的问题
- 在tomcat中三种部署项目的方法
- tomcat中三种部署项目的方法
- J2EE项目在LINUX环境下的部署:三、JDK的安装