[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.)
|
|||
|
|||
|
[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-php5Apache 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) <?phpor Code: (SELECT ALL CODE) nano /var/www/test.phpThen 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-mysqlThe 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 root3. 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 phpmyadminThe 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.confNow restart Apache: Code: (SELECT ALL CODE) /etc/init.d/apache2 restartThat'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 rewriteThen edit /etc/apache2/sites-available/default Find the following Code: (SELECT ALL CODE) Options Indexes FollowSymLinks MultiViewsand change it to Code: (SELECT ALL CODE) Options Indexes FollowSymLinks MultiViewsand finally restart Apache Code: (SELECT ALL CODE) /etc/init.d/apache2 restart:D Hope it's okay. any question just ask! |
|||
|
05-02-2012, 09:02 PM
|
|||
|
|||
|
RE: [TUT] Web Server on Linux Debian
Can't believe I never saw this post. This is some great info. Thanks Lee!
|
|||
|
05-03-2012, 05:25 PM
|
|||
|
|||
|
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.
|
|||
|
05-03-2012, 06:04 PM
|
|||
|
|||
|
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...
|
|||
|
05-05-2012, 05:49 PM
|
|||
|
|||
|
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 |
|||
|
08-20-2012, 03:47 AM
|
|||
|
|||
|
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 |
|||
|
11-22-2012, 01:56 AM
|
|||
|
|||
|
RE: [TUT] Web Server on Linux Debian
Nice, but I suggest using nginx. It is more secure.
|
|||
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 |
|
| Users browsing this thread |
| 1 Guest(s) |







