snipt

Ctrl+h for KB shortcuts

Bash

Ubuntu 12.04 LAMP server up and running with phpmyadmin installed nice and quick!

1
2
3
4
5
6
7
8
#!/bin/bash
sudo apt-get install mysql-server mysql-client
sudo apt-get install apache2
sudo apt-get install php5 libapache2-mod-php5
sudo /etc/init.d/apache2 restart
sudo apt-get install php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl
sudo /etc/init.d/apache2 restart
sudo apt-get install phpmyadmin
https://snipt.net/embed/b8fde2488c189d048f085351633ade5a/
https://snipt.net/raw/b8fde2488c189d048f085351633ade5a/
b8fde2488c189d048f085351633ade5a
bash
Bash
8
2016-09-27T01:04:16
True
False
False
/api/public/snipt/90070/
ubuntu-1204-lamp-server-up-and-running-with-phpmyadmin-installed-nice-and-quick
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a> <a href="#L-8">8</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="c">#!/bin/bash</span> </span><span id="L-2"><a name="L-2"></a>sudo apt-get install mysql-server mysql-client </span><span id="L-3"><a name="L-3"></a>sudo apt-get install apache2 </span><span id="L-4"><a name="L-4"></a>sudo apt-get install php5 libapache2-mod-php5 </span><span id="L-5"><a name="L-5"></a>sudo /etc/init.d/apache2 restart </span><span id="L-6"><a name="L-6"></a>sudo apt-get install php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl </span><span id="L-7"><a name="L-7"></a>sudo /etc/init.d/apache2 restart </span><span id="L-8"><a name="L-8"></a>sudo apt-get install phpmyadmin </span></pre></div> </td></tr></table>
apache2, install, lamp, mysql, php, server

Bash

Add/Remove Apache 2 from Startup

1
2
3
$ sudo update-rc.d apache2 defaults

$ sudo update-rc.d -f apache2 remove
https://snipt.net/embed/476a2fabde8dd72eae892a0975de0611/
https://snipt.net/raw/476a2fabde8dd72eae892a0975de0611/
476a2fabde8dd72eae892a0975de0611
bash
Bash
3
2016-09-27T01:04:16
True
False
False
Jul 30, 2013 at 11:02 PM
/api/public/snipt/70703/
addremove-apache-2-from-startup
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="nv">$ </span>sudo update-rc.d apache2 defaults </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="nv">$ </span>sudo update-rc.d -f apache2 remove </span></pre></div> </td></tr></table>
apache2, bash, ubuntu

ApacheConf

Force SSL on Apache2

1
2
3
4
5
6
# Force all connections to this host/virtualhost to be over SSL.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>
https://snipt.net/embed/21c3d5afa59eed078c537290f7a905a1/
https://snipt.net/raw/21c3d5afa59eed078c537290f7a905a1/
21c3d5afa59eed078c537290f7a905a1
apacheconf
ApacheConf
6
2016-09-27T01:04:16
True
False
False
/api/public/snipt/7222/
force-ssl-on-apache2
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="c"># Force all connections to this host/virtualhost to be over SSL.</span> </span><span id="L-2"><a name="L-2"></a><span class="nt">&lt;IfModule</span> <span class="s">mod_rewrite.c</span><span class="nt">&gt;</span> </span><span id="L-3"><a name="L-3"></a><span class="nb">RewriteEngine</span> <span class="k">On</span> </span><span id="L-4"><a name="L-4"></a><span class="nb">RewriteCond</span> %{HTTPS} <span class="k">off</span> </span><span id="L-5"><a name="L-5"></a><span class="nb">RewriteRule</span> (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] </span><span id="L-6"><a name="L-6"></a><span class="nt">&lt;/IfModule&gt;</span> </span></pre></div> </td></tr></table>
apache2, apacheconf, htaccess

ApacheConf

Redirection HTTPS via le mod rewrite

1
2
3
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.xxx.com/$1 [R,L]
https://snipt.net/embed/948f3b0f6b07780fa5ddf28e86c61379/
https://snipt.net/raw/948f3b0f6b07780fa5ddf28e86c61379/
948f3b0f6b07780fa5ddf28e86c61379
apacheconf
ApacheConf
4
2016-09-27T01:04:16
True
False
False
/api/public/snipt/4185/
redirection-https-via-le-mod-rewrite
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="nb">RewriteEngine</span> <span class="k">On</span> </span><span id="L-2"><a name="L-2"></a><span class="nb">RewriteCond</span> %{SERVER_PORT} <span class="m">80</span> </span><span id="L-3"><a name="L-3"></a><span class="nb">RewriteRule</span> ^(.*)$ https://www.xxx.com/$1 [R,L] </span></pre></div> </td></tr></table>
admin, apache, apache2, https, modrewrite, redirection, serveur, ssl
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.