Ubuntu Apache Webserver: Difference between revisions
No edit summary |
No edit summary |
||
(9 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
<code>you@laptop:~$ ssh root@213.108.110.46</code> | <code>you@laptop:~$ ssh root@213.108.110.46</code> | ||
== Step 2 : Install Apache Webserver == | == Step 2 : Update package manager == | ||
<code>root@jbg:~# apt-get update</code> | |||
== Step 3 : Install Apache Webserver == | |||
<code>root@jbg:~# apt-get install apache2</code> | <code>root@jbg:~# apt-get install apache2</code> | ||
== Step | == Step 4 : Check the Webserver == | ||
Put your instance IP address (ex. 213.108.110.46) into your browser. You should see a page called "Apache2 Ubuntu Default Page". | Put your instance IP address (ex. 213.108.110.46) into your browser. You should see a page called "Apache2 Ubuntu Default Page". | ||
== Step | == Step 5 : Create your own homepage == | ||
<code>root@jbg:~# cd /var/www/html</code> | <code>root@jbg:~# cd /var/www/html</code> | ||
Create a backup of the default page. | Create a backup of the default page. | ||
<code>root@jbg:~# mv index.html index.html.bkup</code> | <code>root@jbg:~# mv index.html index.html.bkup</code> | ||
<code>root@jbg:~# echo '<h1>Welcome 127.0.0.1!</h1>' > index.html</code> | <code>root@jbg:~# echo '<h1>Welcome 127.0.0.1!</h1>' > index.html</code> | ||
== Refresh! == | == Refresh! == | ||
== Step 6 : Copying files == | |||
=== scp === | |||
I recommend using the <code>scp</code> command for copying files, or perhaps your file transfer application (CyberDuck, etc.) of preference also supports scp. File can be moved from your computer to the VPS via the terminal as well. It's a bit like <code>ftp</code>, but encrypted and secure. | |||
Example 1: Copy a new single index.html to the webserver. | |||
<code>you@laptop:~$ scp index.html root@213.108.110.46:/var/www/html</code> | |||
Example 2: Copy an entire directory, files, and sub-directories to the webserver. | |||
<code>you@laptop:~$ scp -r * root@213.108.110.46:/var/www/html</code> | |||
=== ftp === | |||
<code>root@handd:~# apt-get install software-properties-common</code> | |||
<code>root@handd:~# add-apt-repository universe</code> | |||
<code>root@handd:~# apt-get update</code> | |||
Follow directions here: [https://help.ubuntu.com/community/PureFTP https://help.ubuntu.com/community/PureFTP] | |||
{{#widget:Iframe | |||
|url=http://etherpad.hackersanddesigners.nl | |||
|width=410 | |||
|height=342 | |||
|border=0 | |||
}} |
Latest revision as of 15:36, 2 July 2016
Installing Apache Webserver on Ubuntu
Step 1 : SSH to your instance
you@laptop:~$ ssh root@213.108.110.46
Step 2 : Update package manager
root@jbg:~# apt-get update
Step 3 : Install Apache Webserver
root@jbg:~# apt-get install apache2
Step 4 : Check the Webserver
Put your instance IP address (ex. 213.108.110.46) into your browser. You should see a page called "Apache2 Ubuntu Default Page".
Step 5 : Create your own homepage
root@jbg:~# cd /var/www/html
Create a backup of the default page.
root@jbg:~# mv index.html index.html.bkup
root@jbg:~# echo '<h1>Welcome 127.0.0.1!</h1>' > index.html
Refresh!
Step 6 : Copying files
scp
I recommend using the scp
command for copying files, or perhaps your file transfer application (CyberDuck, etc.) of preference also supports scp. File can be moved from your computer to the VPS via the terminal as well. It's a bit like ftp
, but encrypted and secure.
Example 1: Copy a new single index.html to the webserver.
you@laptop:~$ scp index.html root@213.108.110.46:/var/www/html
Example 2: Copy an entire directory, files, and sub-directories to the webserver.
you@laptop:~$ scp -r * root@213.108.110.46:/var/www/html
ftp
root@handd:~# apt-get install software-properties-common
root@handd:~# add-apt-repository universe
root@handd:~# apt-get update
Follow directions here: https://help.ubuntu.com/community/PureFTP
{{#widget:Iframe |url=http://etherpad.hackersanddesigners.nl |width=410 |height=342 |border=0 }}