Login to TechLifeForum X
Board Index Go to Reboot.Pro
  • Account Login
  • Register
TechLifeForum
  • Home
  • Members
  • Awards
  • Rules
  • Help
  • Donate
  • Live IRC
TechLifeForum / Computer Support / Linux Support v
1 2 Next »
/ [TUT] Web Server on Linux Debian[Advanced Search]
Reply to thread
 
Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5

[TUT] Web Server on Linux Debian

04-15-2012, 10:27 AM (This post was last modified: 04-15-2012 10:36 AM by Lee Stevens.)
Post: #1
Lee Stevens Offline
Senior Member
***
Posts: 263
Joined: Feb 2012
Reputation: 8
Coding AwardDonation AwardSpam Protection
[TUT] Web Server on Linux Debian
Hello, Penguin Lovers!

Okay, this is my FIRST Linux Debain or any Linux Tutorial, this one is going to be about setting up a Computer/Server as a Web Host on Debian.

Okay first install Debian FREE :) from here. Once you have completed the installation and logged in we can get started.

1. Installing Apache + PHP
Apache is one of the most famous web server which runs on most Linux based servers. With just few commands you can configure Apache to run with PHP 4 or PHP 5.

For this example we are going to install PHP5, just run the following command on Root Terminal. (Applications > Accessories > Root Terminal).
Code: (SELECT ALL CODE)
apt-get install apache2 php5 libapache2-mod-php5

Apache configuration file is located at: /etc/apache2/apache2.conf and your web folder is /var/www.


To check whether php is installed and running properly, just create a test.php in your /var/www folder with:
PHP Code: (SELECT ALL CODE)
<?php
phpinfo 
();
?>

or

Code: (SELECT ALL CODE)
nano /var/www/test.php

Then input the same as above.

Point your browser to http://localhost/test.php or http://internal.ip/test.php and this should show all your PHP Configuration and default settings.

You can edit necessary values or setup virtual domains using apache configuration file.

2. Installing MySQL Database Server

Remember running MySQL Server to a fair extend requires at least 256MB of RAM. So unless you are running database driven sites you don't absolutely need MySQL.

The following commands will install MySQL 5 Server and MySQL 5 Client.
Code: (SELECT ALL CODE)
apt-get install mysql-server mysql-client php5-mysql

The configuration file of MySQL is located at: /etc/mysql/my.cnf

Creating users to use MySQL and Changing Root Password

By default MySQL creates user as root and runs with no passport. You might need to change the root password.
Code: (SELECT ALL CODE)
mysql -u root
mysql> USE mysql;
mysql> UPDATE user SET Password=PASSWORD('new-password') WHERE user='root';
mysql> FLUSH PRIVILEGES;

3. phpMyAdmin Installation

phpMyAdmin is a web based database management and administration software and easy to install and configure under Apache.
Code: (SELECT ALL CODE)
apt-get install phpmyadmin

The phpMyAdmin configuration file is located at: /etc/phpmyadmin folder.

To set up under Apache all you need to do is include the following line in /etc/apache2/apache2.conf:
Code: (SELECT ALL CODE)
Include /etc/phpmyadmin/apache.conf

Now restart Apache:
Code: (SELECT ALL CODE)
/etc/init.d/apache2 restart

That's your Basic web server set up! Congratulations!

4. Add-ons
That's your Basic web server set up, but i added mod_rewrite to mine so i can use fancy URL's on my sites so i'll show that too:
Code: (SELECT ALL CODE)
a2enmod rewrite

Then edit /etc/apache2/sites-available/default

Find the following
Code: (SELECT ALL CODE)
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all

and change it to
Code: (SELECT ALL CODE)
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all

and finally restart Apache
Code: (SELECT ALL CODE)
/etc/init.d/apache2 restart

:D

Hope it's okay. any question just ask!
Find
Reply
05-02-2012, 09:02 PM
Post: #2
KoBE Offline
¯\_(ツ)_/¯
*******
Administrators
Posts: 4,200
Joined: Jun 2011
Reputation: 47
RE: [TUT] Web Server on Linux Debian
Can't believe I never saw this post. This is some great info. Thanks Lee!

-> TechLifeForum on Facebook<- 
-> TechLifeForum on YouTube<-
-> TechLifeForum on Twitter<-

Tech.Reboot.Pro
WWW Find
Reply
05-03-2012, 05:25 PM
Post: #3
Lee Stevens Offline
Senior Member
***
Posts: 263
Joined: Feb 2012
Reputation: 8
Coding AwardDonation AwardSpam Protection
RE: [TUT] Web Server on Linux Debian
I did wonder when no one posted i was like oh erm, dam no one likes my post lol.
Find
Reply
05-03-2012, 06:04 PM
Post: #4
m0ral Offline
Why so Serious...?
****
Posts: 567
Joined: Jun 2011
Reputation: 13
First 25PhilosopherSpam Protection
RE: [TUT] Web Server on Linux Debian
I've seen it few times, always wasn't able to post or login, then I forgot....
KoBE did however and reminded me... :D

I personally just go wget (x/l)ampp and extract it, it's simple fast and has this little Python script as a Control Panel, besides that you can also easy set passwords for apache, mysql, etc..

The way you describe it is hard for people new to linux, but, it's the way they SHOULD learn it, simply because the more you use linux the more you find your self doing things in the Terminal, so well done tutorial...

Note by side, a link to doc's of "apt-get" would be good, for those who are really new to linux, though they shouldn't really be reading this :D

Why so Serious??? Play League of Legends with me...
Find
Reply
05-05-2012, 05:49 PM
Post: #5
Lee Stevens Offline
Senior Member
***
Posts: 263
Joined: Feb 2012
Reputation: 8
Coding AwardDonation AwardSpam Protection
RE: [TUT] Web Server on Linux Debian
I learnt this way when i only had root access to a Server. I mean yeah sure today's world you have GUI's for everything and packages for everything but i learn at the deep end lol.

And here's the Doc for apt-get: https://help.ubuntu.com/8.04/serverguide/apt-get.html
Find
Reply
08-20-2012, 03:47 AM
Post: #6
DefAnli Offline
Junior Member
**
Posts: 46
Joined: Aug 2012
Reputation: 0
RE: [TUT] Web Server on Linux Debian
Nice tutorial Lee, but i think if new users will use tasksel will be better for them, it is very basic and also simple GUI to install web server.

cheers,

DefAnli
Find
Reply
11-22-2012, 01:56 AM
Post: #7
csin Offline
Junior Member
**
Posts: 15
Joined: Nov 2012
Reputation: 0
RE: [TUT] Web Server on Linux Debian
Nice, but I suggest using nginx. It is more secure.
Find
Reply
Reply to thread


Possibly Related Threads...

Thread: Author Replies: Views: Last Post
  Linux and touch screens Adriana 2 397 02-07-2013 04:18 PM
Last Post: AceInfinity
  Favorite Linux distribution? Adriana 3 230 01-23-2013 10:39 AM
Last Post: Nuno Brito
  Favorite Linux Distro? Predator 20 1,448 01-18-2013 02:38 PM
Last Post: xyv123
  Games on Linux Adriana 7 290 01-09-2013 04:48 AM
Last Post: Adriana
  Resources to learn Linux commands Adriana 3 167 01-06-2013 04:51 AM
Last Post: Adriana

  • View a Printable Version
  • Send this Thread to a Friend
  • Subscribe to this thread
Forum Jump:


Users browsing this thread
1 Guest(s)
Youtube Facebook Twitter Digg
Return to Top
All content © copyright TechLifeForum
Powered By MyBB, © 2002-2013 MyBB Group
Designed by ThemeFreak
Mobile Version