Showing posts with label server. Show all posts
Showing posts with label server. Show all posts

Saturday, June 2, 2012

How to make a website (Linux)

The internet is a hard subject to grasp if you do not understand networking. All it is is a system of servers connected by an internet service provider, which give you access to all of these servers. There is nothing special about a server, either. It is just a computer like the one you are using. You too can set up a website to use locally and over the internet. Here is how to do it in any variant of Gnu/Linux that has Apache and Kompozer (optional).

This article assumes that you have no knowledge of HTML (The Hypertext Markup Language), which is what websites are technically written in. Instead we will use a program called kompozer that is generates HTML similar to how blogger does.

Run these two commands to get started:

sudo apt-get install apache2
sudo apt-get install kompozer

The first command installs the server software and the second installs kompozer, the editor we will be using. After you install apache2, a directory named "www" will be created in /var. This is where you will place the file named "index.html".

You can link to other pages from the main one by making a link with the name of a file in /var/www or any other file on the computer.

Write the Webpage
 Run kompozer with root privileges. (sudo kompozer). You are going to be saving the file in /var/www which is a protected directory by default. Now, all you have to do is... write. Kompozer has all of the tools you will need to make your basic web page. Add text, links, bold text, italicized text, pictures, or whatever you need. If you need mroe power you can edit the HTML directly from the "source" tab if you must. When you are done writing your web page, save it.

The first dialog that will come up will ask you for a title. Name it whatever you want the name of this page to be. This will appear in tabs and on some window lists. Hit okay, and save it as "index.html" in /var/www.

Viewing
You now have a website available on your machine to the world wide web and to your local network. Find your ip address by typing

ifconfig

into the terminal. The wlan address is your IP address. Your local network can access the webpage from this address. To view it from anywhere in the world, you need to port forward your router. To do so, look up your router's manual on port forwarding. My router has an "advanced" dialog at 192.168.0.1, so that may be a good place to start looking. After the forwarding has been set up, you can go to http://your_public_ip to see your website. Typing "ip" into a google search will show you your public IP to use.

Tuesday, May 29, 2012

Setting up and FTP server in Linux

This tutorial is for Gnu/Linux operating systems. Windows users can use the filezilla server: http://filezilla-project.org/download.php?type=server

A server is the name given to a piece of hardware running software that allows it to interact with client computers. All websites run on servers. This is a tutorial that uses a set of tools to configure a special type of server that uses FTP, the File Transfer Protocol. This is used for the transfer of files between computers. It is similar to what cloud storage services such as Dropbox or Skydrive offer.

The tools
To get the server running we will be using gadmin-proftpd. This is a GTK+ frontend to proftpd, the command line tool. Download it from sudo apt-get install gadmin-proftpd. Run it and enter the root password. The next few sections will describe each tab you need to fill in.

Servers
You need to fill in some of these blank fields. For Server Address use the inet addr from wlan of the ifconfig output in the terminal. The server name can be anything. Admin email should be your real email address. Skip down to where it says "signed certificate settings". You should fill this information in and use the "Apply" button to make a new certificate. Failure to complete this step of the setup process is what causes most errors with gadmin-proftpd.

Users
Users is the last tab you should have to fill out.  Fill in the username and password as you want them. Others will need to fill in this information, so make it reasonable. Go to the bottom and click "Add Directory". You should make a directory in /var/www called ftp (it can be called whatever you want it to be) that will act as this new user's directory. This will become the root ftp directory for that user (kind of like / for a normal user). If you want full access over a machine, make this "/".  Click "New User". This user will now be created.

Afterwards
 At the top of the application, click "Activate". The server will then be running. To access the server, go to your browser and type: "ftp://[your ip]" where [your ip] is you full ip address. To add directories and upload data you will need a program like bareftp, (sudo apt-get install bareftp) filezilla (which doesn't play nice with proftpd servers), or a windows program like coreftpd.

Extras
This is a local server only. You can make it point to the internet in your router settings. Your router setup (the ip address of your router, sometimes 192.168.0.1) should have some type of "advanced" dialog where you can set up your server. FTP runs on port 21, so you would need to fill in the protocol, port, and IP address wherever the dialog may ask for it. If it asks for a name like our D-link router does, fill it in with the name of your computer. Now, when you visit your external ip address (find this with "ip" on google) using the ftp protocol it will go to your server.

You can also use a no-ip.com host (which are free) to avoid the need to remember the ip address of the server.