Create a linux web server

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
jack0987
Level 3
Level 3
Posts: 114
Joined: Fri Jul 18, 2014 9:24 pm

Create a linux web server

Post by jack0987 » Fri Jul 18, 2014 9:36 pm

This is my first time with linux.

I choose to try and use Linux Mint 17 cinnamon and have installed it.
The only glitch I have had so far is that when the install completed and I choose to restart the computer did not do so.
I had to manually shut it off and turn it back on. Seems ok now.

Now, I would like to set it up as a web server.

Where do I go from here? Is there a step by step tutorial?

Thanks.

User avatar
Ginsu543
Level 4
Level 4
Posts: 450
Joined: Thu Nov 24, 2011 3:15 am
Location: Los Angeles, CA, USA

Re: Create a linux web server

Post by Ginsu543 » Sat Jul 19, 2014 1:30 am

Check out this website to set up a Linux Mint-based LAMP setup.
Main: Intel Core i7 920 D0 @ 4.0 GHz | Asus P6X58D Premium | 12 GB Mushkin Redline PC3-12800 7-8-7-24 | EVGA GeForce GTX 560 Ti | Mint 17.2 Cinnamon 64 / OS X 10.7.3
Portables: Toshiba Portege R200 | Mint 17.2 Cinnamon 32 / Dell Mini 9 | OS X 10.6.7

User avatar
eanfrid
Level 7
Level 7
Posts: 1859
Joined: Mon Apr 30, 2012 2:49 am
Location: FR

Re: Create a linux web server

Post by eanfrid » Sat Jul 19, 2014 4:27 am

This is the very first step of a long journey. These instructions only give you the basic requirements to start Apache with php and mysql with a security level close to zero. It is almost ok for a test LAN web server. If however you actually want to setup an Internet web server, there is much more to do, much more everyday work and much more to learn about LAMP setup and security... You basically installed the oven and plugged the power cord; now it is time to learn cooking.
Main desktop: Debian GNU/Linux Jessie 64bit - MATE
(i5 2400@3.7GHz - 16GB DDR3 - HD6770 w/radeon driver - SSD+RAID1)
Safer than Dropbox

jack0987
Level 3
Level 3
Posts: 114
Joined: Fri Jul 18, 2014 9:24 pm

Re: Create a linux web server

Post by jack0987 » Sat Jul 19, 2014 11:21 am

Thanks for the replies Ginsu543 and eanfrid.

I will follow that tutorial. I had googled and found it earlier but thought it was only for setting up a local instance for development.

eanfrid. You say "it almost ok for a test LAN server." I do intend to connect it to the internet.
Where do I go from here?

User avatar
eanfrid
Level 7
Level 7
Posts: 1859
Joined: Mon Apr 30, 2012 2:49 am
Location: FR

Re: Create a linux web server

Post by eanfrid » Sat Jul 19, 2014 5:42 pm

For Apache: http://httpd.apache.org/docs/2.4/en/ (Apache has an excellent online documentation)
Otherwise, Google will lead you toward thousands of Apache tutorials from beginner to expert for debian/ubuntu.
Main desktop: Debian GNU/Linux Jessie 64bit - MATE
(i5 2400@3.7GHz - 16GB DDR3 - HD6770 w/radeon driver - SSD+RAID1)
Safer than Dropbox

jack0987
Level 3
Level 3
Posts: 114
Joined: Fri Jul 18, 2014 9:24 pm

Re: Create a linux web server

Post by jack0987 » Sun Jul 20, 2014 10:55 am

Thanks eanfrid. I am reading the apache docs now and will attempt to install it shortly.

I was thinking of using the mariadb instead of mysql.
As I understand, mysql is now part of Oracle and I feel we can not longer depend on a for profit company to reliably support it.
In relation to this, already I have read comments such as "the open office debacle".

My question here is: Should I use the mariadb 5.5 or the newer 10.0 version?

User avatar
eanfrid
Level 7
Level 7
Posts: 1859
Joined: Mon Apr 30, 2012 2:49 am
Location: FR

Re: Create a linux web server

Post by eanfrid » Sun Jul 20, 2014 1:11 pm

I actually use mariadb on all "my" web servers (those I setup by myself on Debian). It replaces perfectly mysql. Current version is 5.5.38. I did not dare to jump to 10.x yet for my business and I think it is not necessary at the time. Maybe later this year.

If you are starting from scratch, mariadb is indeed a good choice, at least with 5.5.x releases.
Main desktop: Debian GNU/Linux Jessie 64bit - MATE
(i5 2400@3.7GHz - 16GB DDR3 - HD6770 w/radeon driver - SSD+RAID1)
Safer than Dropbox

jack0987
Level 3
Level 3
Posts: 114
Joined: Fri Jul 18, 2014 9:24 pm

Re: Create a linux web server

Post by jack0987 » Mon Jul 21, 2014 10:51 am

Thinking forward:

For now my linux web server will not be on my present LAN but be by itself on it's own ip address.
In view of this, I will need a way to manage it and place content on it.
Doing some searching on the web, I have come up with these:


For remote desktop from this link:
http://mvtechjourney.wordpress.com/2012 ... -to-linux/

From Windows => Linux : Use xrdp
sudo apt-get install xrdp

The good thing, once you have xrdp running(which runs automatically after installation) you can connect to it using Microsoft Remote Desktop Client(mstsc) or VNC Viewer (RealVNC)


For FTP from this link:
http://www.jonathanmoeller.com/screed/?p=3947

sudo apt-get install vsftpd

The short tutorial is for Linux Mint 13 so I hope it is not way out of date.

Anyone, please comment or prehaps make a more up to date suggestion.

User avatar
js3915
Level 3
Level 3
Posts: 177
Joined: Fri Jul 05, 2013 5:35 pm

Re: Create a linux web server

Post by js3915 » Mon Jul 21, 2014 11:33 am

jack0987 wrote: From Windows => Linux : Use xrdp
sudo apt-get install xrdp
I would suggest looking at webmin versus doing rdp especially if this machine is more or less headless sitting in a closet or server room.. Gives you a nice web access with a whole slew of tools for manging apache mysql and tons of others versus using an rdp and a hodgepodge of tools and if you get comfortable enough can kill the GUI and use that memory elsewhere in your system.. It can have two form authentication for increased security SSL cert compatible its really a wonderful tool to use
http://webmin.com/

Its really simple to setup even esp the debian version since this is mint

User avatar
eanfrid
Level 7
Level 7
Posts: 1859
Joined: Mon Apr 30, 2012 2:49 am
Location: FR

Re: Create a linux web server

Post by eanfrid » Mon Jul 21, 2014 12:34 pm

On an headless machine to be remotely controlled, ssh is the king's road :) If you like web GUIs, as pointed above, Webmin will efficiently help to quickly manage 80% of casual admin tasks through a point-and-click interface.
Main desktop: Debian GNU/Linux Jessie 64bit - MATE
(i5 2400@3.7GHz - 16GB DDR3 - HD6770 w/radeon driver - SSD+RAID1)
Safer than Dropbox

User avatar
js3915
Level 3
Level 3
Posts: 177
Joined: Fri Jul 05, 2013 5:35 pm

Re: Create a linux web server

Post by js3915 » Mon Jul 21, 2014 12:45 pm

eanfrid wrote:On an headless machine to be remotely controlled, ssh is the king's road :)
Agreed, but webmin is a good middle road versus relying on rdp and as this seems tobe the first linux server the op is setting up.. I typically use SSH but the webmin web-interface is nice and light resources versus using some form of RDP.
There really isnt a great GUI for apache anyways i found webmin tobe good as any

User avatar
js3915
Level 3
Level 3
Posts: 177
Joined: Fri Jul 05, 2013 5:35 pm

Re: Create a linux web server

Post by js3915 » Mon Jul 21, 2014 12:57 pm

jack0987 wrote:My question here is: Should I use the mariadb 5.5 or the newer 10.0 version?
Not sure if Mint repos has 10 yet as default as my server is plain old debian.. 5.5 is considered most stable as been out for awhile. however 10 is considered a stable release. There is newer features in 10 as well as performance inprovements you just have to see if something you want.. Also you have to remember if you go with 5.5 eventually you might want to upgrade to 10. If your starting with nothing might keep that in mind.. There always pluses and minuses.. I know there times in the past i got a version then regretted not pushing for a newer version when i went with the older one but then again its all a choice what you feel comfortable with.. Something that been around for 2-3 years or something that was considered finally a stable release earlier this year

jack0987
Level 3
Level 3
Posts: 114
Joined: Fri Jul 18, 2014 9:24 pm

Re: Create a linux web server

Post by jack0987 » Tue Jul 22, 2014 12:12 am

Now that I have my IP issues solved thanks to wharfrat, it's back here to the task at hand.

Thanks so much for the helpful suggestions. I will definitely try SSH and webadmin. But not right now.
I will also try a remote desktop later as well. Right now, the linux machine is right next to me (not in the closet yet) attached to my KVM.
I ran an ethernet cable up to it.

In the next few days I will install apache, the database engine, and PHP and see if by Monday I can get a simple website going.

I will start with mariadb 5.5 first and experiment. I am wondering about the ability to bring it's databases forward to version 10.

octathlon
Level 2
Level 2
Posts: 61
Joined: Sat Jun 28, 2014 3:14 pm

Re: Create a linux web server

Post by octathlon » Tue Jul 22, 2014 1:04 am

Ars Technica has a good series on setting up a server using nginx, php, mariadb, etc.
Part I is at: http://arstechnica.com/gadgets/2012/11/ ... eb-server/
Mint 19 Cinnamon 64bit on Dell Inspiron N7110 Dual core Intel Core i5-2450M
Mint 19 XFCE 64bit on System76 Pangolin Intel Core 2 duo
Full-time Linux user since 2007, Mint since 2014

jack0987
Level 3
Level 3
Posts: 114
Joined: Fri Jul 18, 2014 9:24 pm

Re: Create a linux web server

Post by jack0987 » Wed Jul 23, 2014 1:45 am

Thanks octatholon.

I thought nginx was only for selecting which server will get a specific http request.
I will look into it.

At this time, I will be installing apache.

jack0987
Level 3
Level 3
Posts: 114
Joined: Fri Jul 18, 2014 9:24 pm

Re: Create a linux web server

Post by jack0987 » Wed Jul 23, 2014 11:23 am

Starting to do my installs, I have been following the tutorial (http://community.linuxmint.com/tutorial/view/486) earlier suggested by Ginsu543.

The apache and PHP installs appear to have gone fine.

The apache test also appears to be ok.
with a little looking about it appears to have installed apache/2.4.7(ubuntu) and
the test page says "apache ubuntu default page".
I was wondeing if a dated tutorial would install the latest versions with a generic command.
Should I be using a ubuntu version for linux mint?

Likewise, php installed php version 5.5.9-1 ubuntu4.3
Again, should I be using a ubuntu version for linux mint?

Moving on, testing the php install per the tutorial instructions failed I think because the line in step 1

sudo gedit /var/www/testphp.php

should be

sudo gedit /var/www/html/testphp.php

I came up with this looking at the file system.

I tried to move the file with the GUI but it would not let me saying I am not the owner.
Why? Can I change this?

User avatar
eanfrid
Level 7
Level 7
Posts: 1859
Joined: Mon Apr 30, 2012 2:49 am
Location: FR

Re: Create a linux web server

Post by eanfrid » Wed Jul 23, 2014 11:53 am

You seem to not be aware (how could you ? :? ) that the Mint main edition is 90% of Ubuntu under the hood :)
Main desktop: Debian GNU/Linux Jessie 64bit - MATE
(i5 2400@3.7GHz - 16GB DDR3 - HD6770 w/radeon driver - SSD+RAID1)
Safer than Dropbox

User avatar
js3915
Level 3
Level 3
Posts: 177
Joined: Fri Jul 05, 2013 5:35 pm

Re: Create a linux web server

Post by js3915 » Wed Jul 23, 2014 1:43 pm

jack0987 wrote:sudo gedit /var/www/html/testphp.php

I came up with this looking at the file system.

I tried to move the file with the GUI but it would not let me saying I am not the owner.
Why? Can I change this?
Well this is because linux security and filesystem is alot better than windows, though you might see it as a pain up front really saves from malicious things in the end its why like 90% of the worlds servers are unix based :D

Basically your normal user account joesmith whatever it is cant do anything outside of his "home directory" obviously a security feature so he cant accidently delete an important file like most windows users can do.. obviously your user is in the sudo group so If you want to move a file you need to use sudo mv /whateverdirectory/whatever/file /towhateverdirectory/etc/etc

hopefully that helps and gives a small bit of insight and a window to linux filesystem privileges.. Its way more powerful and could take up a lot more space :D

jack0987
Level 3
Level 3
Posts: 114
Joined: Fri Jul 18, 2014 9:24 pm

Re: Create a linux web server

Post by jack0987 » Thu Jul 24, 2014 11:20 am

Thanks for the replies.

I do prefer working from the GUI if possible. If I could log in as root in the GUI from time to time it would be helpful.
Is there a way?

Moving on, I am now ready to install the database engine.

Though I plan to use MariaDB, I was wondering if I also could install mysql to have a look at it?

Also, per my GUI preference, I was looking about for a MariaDB GUI administrator but did not find one on the MariaDB site.
Is there one.

jack0987
Level 3
Level 3
Posts: 114
Joined: Fri Jul 18, 2014 9:24 pm

Re: Create a linux web server

Post by jack0987 » Thu Jul 24, 2014 1:22 pm

I am having difficulties installing MariaDB and do not know where to begin to reslove the prolem.
I am not sure what has or has not happened on my linux computer.

I am following the instructions on their website at:

https://downloads.mariadb.org/mariadb/r ... locean-sfo

When I get to the last part and enter the command:

sudo apt-get install mariadb-serverSee

I get the message "unable to locate package mariadb-serverSee"

Please comment.

Post Reply

Return to “Newbie Questions”