-
-
Save acedesigns/465e77ff8559ebebe8eeb13e781a6584 to your computer and use it in GitHub Desktop.
Revisions
-
AJNOURI revised this gist
Mar 20, 2016 . 1 changed file with 15 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,7 @@ organizationalunit=IT [email protected] echo "########### Installing apache, php5 and openssl packages..." apt-get update && apt-get install -y apache2 apache2-doc apache2-utils openssl php5 libapache2-mod-php5 mkdir /etc/apache2/ssl @@ -31,9 +31,20 @@ a2ensite default-ssl.conf echo "########### Restarting Apache..." service apache2 start sed -i .bak "'SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem'/'SSLCertificateFile /etc/apache2/ssl/apache.cert'/g" /etc/apache2/sites-available/default-ssl.conf SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key cd /var/www/html cat > test.php << EOF <?php header('Content-Type: text/plain'); echo "Server IP: ".$_SERVER['SERVER_ADDR']; echo "\nClient IP: ".$_SERVER['REMOTE_ADDR']; echo "\nIP used by client = ".$_SERVER['HTTP_HOST']; echo "\nX-Forwarded-for: ".$_SERVER['HTTP_X_FORWARDED_FOR']; echo "\nDNS name used by client = ".$_SERVER['SERVER_NAME']; ?> EOF cat test.php -
AJNOURI revised this gist
Mar 20, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -22,8 +22,8 @@ echo "########### Enable apache ssl module..." a2enmod ssl echo "########### Configuring vhost to listen to ssh..." sed -i 's|/etc/ssl/certs/ssl-cert-snakeoil.pem|/etc/apache2/ssl/apache.cert|' /etc/apache2/sites-available/default-ssl.conf sed -i 's|/etc/ssl/private/ssl-cert-snakeoil.key|/etc/apache2/ssl/apache.key|' /etc/apache2/sites-available/default-ssl.conf echo "########### Loading new ssl conf..." a2ensite default-ssl.conf -
AJNOURI revised this gist
Mar 20, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ [email protected] echo "########### Installing apache and openssl packages..." apt-get update && apt-get install -y apache2 apache2-doc apache2-utils openssl php5 libapache2-mod-php5 mkdir /etc/apache2/ssl -
AJNOURI revised this gist
Mar 20, 2016 . 1 changed file with 11 additions and 6 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -21,14 +21,19 @@ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apa echo "########### Enable apache ssl module..." a2enmod ssl echo "########### Configuring vhost to listen to ssh..." RUN sed -i 's|/etc/ssl/certs/ssl-cert-snakeoil.pem|/etc/apache2/ssl/apache.cert|' /etc/apache2/sites-available/default-ssl.conf RUN sed -i 's|/etc/ssl/private/ssl-cert-snakeoil.key|/etc/apache2/ssl/apache.key|' /etc/apache2/sites-available/default-ssl.conf echo "########### Loading new ssl conf..." a2ensite default-ssl.conf echo "########### Restarting Apache..." service apache2 start sed -i .bak "'SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem'/'SSLCertificateFile /etc/apache2/ssl/apache.cert'/g" /etc/apache2/sites-available/default-ssl.conf SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key -
AJNOURI revised this gist
Mar 18, 2016 . No changes.There are no files selected for viewing
-
AJNOURI created this gist
Mar 18, 2016 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ #!/bin/bash commonname=apachehttps.lab country=FR state=IDF locality=Panam organization=cciethebeginning.wordpress.com organizationalunit=IT [email protected] echo "########### Installing apache and openssl packages..." apt-get update && apt-get install -y apache2 apache2-doc apache2-utils openssl mkdir /etc/apache2/ssl openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.cert -subj "/C=$country/ST=$state/L=$locality/O=$organization/OU=$organizationalunit/CN=$commonname/emailAddress=$email" echo "########### Enable apache ssl module..." a2enmod ssl echo "########### Including new SSL keys..." sed -i 's|/etc/ssl/certs/ssl-cert-snakeoil.pem|/etc/apache2/ssl/apache.cert|' /etc/apache2/sites-available/default-ssl.conf sed -i 's|/etc/ssl/private/ssl-cert-snakeoil.key|/etc/apache2/ssl/apache.key|' /etc/apache2/sites-available/default-ssl.conf echo "########### Loading new ssl conf..." a2ensite default-ssl.conf echo "########### Restarting Apache..." service apache2 start