Advertisement
Guest User

here's /johnny/

a guest
May 8th, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.55 KB | None | 0 0
  1. via: Google Cloud
  2. using: ubuntu-1204-precise-v20160320
  3.  
  4. tutorial: [https://www.howtoforge.com/how-to-set-up-apache2-with-mod_fcgid-and-php5-on-ubuntu-12.04]
  5. tips: [https://serversforhackers.com/configuring-apache-virtual-hosts]
  6. ####################################################################
  7.  
  8. sudo dpkg-reconfigure tzdata
  9.  
  10. sudo /etc/init.d/apparmor stop
  11. sudo update-rc.d -f apparmor remove
  12. sudo apt-get remove apparmor apparmor-utils
  13.  
  14. sudo apt-get install apache2 apache2-suexec libapache2-mod-fcgid php5-cgi
  15. sudo a2dismod php5
  16. sudo a2enmod rewrite
  17. sudo a2enmod suexec
  18. sudo a2enmod include
  19. sudo a2enmod fcgid
  20.  
  21. sudo nano /etc/php5/cgi/php.ini
  22.    @==={{ Uncomment the line "cgi.fix_pathinfo = 1:"
  23. sudo nano /etc/apache2/mods-available/fcgid.conf
  24.    @==={{ add the line "PHP_Fix_Pathinfo_Enable 1" within the <IfModule>
  25.  
  26. sudo service apache2 restart
  27.  
  28. sudo adduser clarence www-data
  29.  
  30. sudo groupadd johnny
  31. sudo useradd -s /bin/bash -d /var/www/johnny -m -g johnny johnny
  32. sudo passwd johnny
  33. sudo ssh-keygen -t rsa -f ~/.ssh/johnny -C johnny
  34. sudo cat /home/clarence/.ssh/johnny
  35. sudo cat /home/clarence/.ssh/johnny.pub
  36.  
  37. sudo adduser johnny www-data
  38. sudo mkdir -p /var/www/johnny/public_html
  39. sudo chown -R johnny:www-data /var/www/johnny/public_html
  40. sudo chmod -R g+rwX /var/www/johnny/public_html
  41. find /var/www/johnny/public_html -type d -print0 | sudo xargs -0 chmod g+s
  42.  
  43. sudo mkdir -p /var/www/php-fcgi-scripts/johnny
  44. sudo nano /var/www/php-fcgi-scripts/johnny/php-fcgi-starter
  45.    @___________________________________________________________________
  46.    #!/bin/sh
  47.    PHPRC=/etc/php5/cgi/
  48.    export PHPRC
  49.    export PHP_FCGI_MAX_REQUESTS=5000
  50.    export PHP_FCGI_CHILDREN=8
  51.    exec /usr/lib/cgi-bin/php -c /var/www/johnny
  52.    @___________________________________________________________________
  53.    @-------------------------------------------------------------------
  54.  
  55. sudo chmod 755 /var/www/php-fcgi-scripts/johnny/php-fcgi-starter
  56. sudo chown -R johnny:johnny /var/www/php-fcgi-scripts/johnny
  57.  
  58. sudo nano /etc/apache2/sites-available/johnny.conf
  59.    @___________________________________________________________________
  60.    <VirtualHost _default_:80>
  61.      ServerName johnny.10.128.0.2.xip.io
  62.      ServerAlias my.dev.server.public.IP
  63.      DocumentRoot /var/www/johnny/public_html/
  64.      
  65.      <IfModule mod_fcgid.c>
  66.        SuexecUserGroup johnny johnny
  67.        <Directory /var/www/johnny/public_html/>
  68.          Options +ExecCGI -Indexes +FollowSymLinks +MultiViews
  69.          AllowOverride All
  70.          AddHandler fcgid-script .php .htm .html
  71.          FCGIWrapper /var/www/php-fcgi-scripts/johnny/php-fcgi-starter .php
  72.          FCGIWrapper /var/www/php-fcgi-scripts/johnny/php-fcgi-starter .htm
  73.          FCGIWrapper /var/www/php-fcgi-scripts/johnny/php-fcgi-starter .html
  74.          Order allow,deny
  75.          Allow from all
  76.        </Directory>
  77.      </IfModule>
  78.      
  79.      ErrorLog /var/log/apache2/johnny-error.log
  80.      CustomLog /var/log/apache2/johnny-access.log combined
  81.      LogLevel warn
  82.      ServerSignature Off
  83.    </VirtualHost>
  84.    @___________________________________________________________________
  85.    @-------------------------------------------------------------------
  86.  
  87. sudo a2ensite johnny.conf
  88.  
  89. sudo service apache2 restart
  90.  
  91. sudo apt-get install php5-curl
  92. sudo apt-get install php5-gd
  93. sudo apt-get install php5-imap
  94. sudo apt-get install php5-mcrypt
  95. sudo apt-get install php5-mysql
  96. sudo apt-get install php5-pspell
  97. sudo apt-get install php5-sqlite
  98. sudo apt-get install php5-tidy
  99. sudo apt-get install php5-xmlrpc
  100. sudo apt-get install php5-xsl
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement