Created
November 4, 2014 16:23
-
-
Save nabe256/366f6bcb426d939db3cf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo apt-get install nginx | |
$ sudoedit /etc/apache2/apache2.conf /etc/apache2/ports.conf | |
#Listen 80 | |
Listen 8080 | |
$ sudo service apache2 restart | |
$ sudo service nginx start | |
$ sudo apt-get install php5-fpm php5-cgi | |
$ sudo service php5-fpm start | |
$ sudoedit /etc/nginx/sites-available/default | |
location ~ \.php$ { | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini | |
# With php5-cgi alone: | |
#fastcgi_pass 127.0.0.1:9000; | |
# With php5-fpm: | |
fastcgi_pass unix:/var/run/php5-fpm.sock; | |
fastcgi_index index.php; | |
include fastcgi_params; | |
} | |
$ sudoedit /etc/php5/fpm/php.ini | |
;cgi.fix_pathinfo=1 | |
cgi.fix_pathinfo=0 | |
$ sudoedit /etc/php5/fpm/pool.d/www.conf | |
listen = /var/run/php5-fpm.sock | |
$ sudo service php5-fpm restart | |
$ sudo apt-get install tomcat7 tomcat7-user tomcat7-admin | |
$ sudoedit /etc/default/tomcat7 | |
JAVA_HOME=/usr/lib/jvm/default-java | |
$ sudoedit /etc/tomcat7/tomcat-users.xml | |
<user username="admin" password="pass" roles="manager-gui,admin-gui"/> | |
$ sudoedit /etc/tomcat7/server.xml | |
<Connector port="8081" protocol="HTTP/1.1" | |
connectionTimeout="20000" | |
URIEncoding="UTF-8" | |
redirectPort="8443" /> | |
$ sudoedit /usr/share/tomcat7/setenv.sh | |
JENKINS_ARGS="--prefix=/jenkins" | |
$ wget http://mirrors.jenkins-ci.org/war/latest/jenkins.war | |
$ sudo cp jenkins.war /var/lib/tomcat7/webapps/jenkins##1587.war | |
$ sudoedit /etc/nginx/sites-available/jenkins | |
upstream app_server { | |
server 127.0.0.1:8081 fail_timeout=0; | |
} | |
server { | |
proxy_set_header Host $http_host; | |
location ~ /jenkins { | |
proxy_read_timeout 300; # Some requests take more than 30 seconds. | |
proxy_connect_timeout 300; # Some requests take more than 30 seconds. | |
proxy_redirect off; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_set_header Host $http_host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $host; | |
proxy_pass http://app_server; | |
#access_log /var/log/nginx/jenkins_access.log; | |
#error_log /var/log/nginx/jenkins_error.log; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment