Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- via: Google Cloud
- using: ubuntu-1204-precise-v20160320
- tutorial: [https://www.howtoforge.com/how-to-set-up-apache2-with-mod_fcgid-and-php5-on-ubuntu-12.04]
- tips: [https://serversforhackers.com/configuring-apache-virtual-hosts]
- ####################################################################
- sudo dpkg-reconfigure tzdata
- sudo /etc/init.d/apparmor stop
- sudo update-rc.d -f apparmor remove
- sudo apt-get remove apparmor apparmor-utils
- sudo apt-get install apache2 apache2-suexec libapache2-mod-fcgid php5-cgi
- sudo a2dismod php5
- sudo a2enmod rewrite
- sudo a2enmod suexec
- sudo a2enmod include
- sudo a2enmod fcgid
- sudo nano /etc/php5/cgi/php.ini
- @==={{ Uncomment the line "cgi.fix_pathinfo = 1:"
- sudo nano /etc/apache2/mods-available/fcgid.conf
- @==={{ add the line "PHP_Fix_Pathinfo_Enable 1" within the <IfModule>
- sudo service apache2 restart
- sudo adduser clarence www-data
- sudo groupadd johnny
- sudo useradd -s /bin/bash -d /var/www/johnny -m -g johnny johnny
- sudo passwd johnny
- sudo ssh-keygen -t rsa -f ~/.ssh/johnny -C johnny
- sudo cat /home/clarence/.ssh/johnny
- sudo cat /home/clarence/.ssh/johnny.pub
- sudo adduser johnny www-data
- sudo mkdir -p /var/www/johnny/public_html
- sudo chown -R johnny:www-data /var/www/johnny/public_html
- sudo chmod -R g+rwX /var/www/johnny/public_html
- find /var/www/johnny/public_html -type d -print0 | sudo xargs -0 chmod g+s
- sudo mkdir -p /var/www/php-fcgi-scripts/johnny
- sudo nano /var/www/php-fcgi-scripts/johnny/php-fcgi-starter
- @___________________________________________________________________
- #!/bin/sh
- PHPRC=/etc/php5/cgi/
- export PHPRC
- export PHP_FCGI_MAX_REQUESTS=5000
- export PHP_FCGI_CHILDREN=8
- exec /usr/lib/cgi-bin/php -c /var/www/johnny
- @___________________________________________________________________
- @-------------------------------------------------------------------
- sudo chmod 755 /var/www/php-fcgi-scripts/johnny/php-fcgi-starter
- sudo chown -R johnny:johnny /var/www/php-fcgi-scripts/johnny
- sudo nano /etc/apache2/sites-available/johnny.conf
- @___________________________________________________________________
- <VirtualHost _default_:80>
- ServerName johnny.10.128.0.2.xip.io
- ServerAlias my.dev.server.public.IP
- DocumentRoot /var/www/johnny/public_html/
- <IfModule mod_fcgid.c>
- SuexecUserGroup johnny johnny
- <Directory /var/www/johnny/public_html/>
- Options +ExecCGI -Indexes +FollowSymLinks +MultiViews
- AllowOverride All
- AddHandler fcgid-script .php .htm .html
- FCGIWrapper /var/www/php-fcgi-scripts/johnny/php-fcgi-starter .php
- FCGIWrapper /var/www/php-fcgi-scripts/johnny/php-fcgi-starter .htm
- FCGIWrapper /var/www/php-fcgi-scripts/johnny/php-fcgi-starter .html
- Order allow,deny
- Allow from all
- </Directory>
- </IfModule>
- ErrorLog /var/log/apache2/johnny-error.log
- CustomLog /var/log/apache2/johnny-access.log combined
- LogLevel warn
- ServerSignature Off
- </VirtualHost>
- @___________________________________________________________________
- @-------------------------------------------------------------------
- sudo a2ensite johnny.conf
- sudo service apache2 restart
- sudo apt-get install php5-curl
- sudo apt-get install php5-gd
- sudo apt-get install php5-imap
- sudo apt-get install php5-mcrypt
- sudo apt-get install php5-mysql
- sudo apt-get install php5-pspell
- sudo apt-get install php5-sqlite
- sudo apt-get install php5-tidy
- sudo apt-get install php5-xmlrpc
- sudo apt-get install php5-xsl
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement