Вы находитесь на странице: 1из 6

Reazul.

net
LINUX, PHP, SERVER

HOW TO SETUP WEB SERVER IN UBUNTU AND LINUX MINT


FEBRUARY 3, 2012 | REAZUL IQBAL | 1 COMMENT

Step 1: Installing Apache and PHP Apache is the most popular web server software and PHP is the most popular scripting language among programmers. Most of the websites you visit use PHP and Apache. To install Apache an PHP in your Ubuntu or LinuxMint open the Terminal and write down the below command then press Enter and type your password.

s u d oa p t g e ti n s t a l la p a c h e 2p h p 5

Necessary packages for Apache and PHP will be installed automatically. Step 2: Installing mySQL server mySQL is a popular SQL supported database server. We are using this to use or make database supported supported web programs like WordPress, Drupal etc. We will also install php5-mysql package to interact with mySQL server via PHP. Open up the Terminal and write down the below command.

s u d oa p t g e ti n s t a l lm y s q l s e r v e rp h p 5 m y s q l

It will install all the necessary package for our mySQL server. After downloading all the files, while installing a pop-up will be shown (like below picture) to enter a password for root user.

Configuring mySQL server

Enter a password press Ok then re-enter the password, thats it. Step 3: Installing phpMyAdmin phpMyAdmin is an opensource program to handle the administration of mySQL server with the help of web browsers. It can perform various tasks such as creating, modifying or deleting databases, tables, fields or rows; executing SQL statements; or managing users and permissions. To install phpMyAdmin, execute the command in Terminal.

s u d oa p t g e ti n s t a l lp h p m y a d m i n

While installing you will be promoted to select a server, select apache2 by pressing space key.

Select apache2 server

Then navigate to ok and press Enter. Then press yes to configure phpMyAdmin

Configure phpMyAdmin

Enter your root password

Enter root Password

Enter you password for phpMyAdmin

Password for phpMyAdmin

Enter the previous password again. That it! Our web server is all set to use. Step 4: Enabling mod_rewrite

This step is only for if you want to enable mod_rewrite to rewrite URLs. Open the Terminal and type the following command line.

sudoa2enmodrewrite

Thenedit/etc/apache2/sitesavailable/defaultor/etc/apache2/sitesavailable/000default(checkwhatisavailableonyour system).Youcandoitmanuallyoryoucanenterthefollowingcommand.

sudogedit/etc/apache2/sitesavailable/default

Trytofindthefollowinglines

Default File

<Directory/var/www/>

OptionsIndexesFollowSymLinksMultiViews

AllowOverrideNone

Orderallow,deny

allowfromall

</Directory>

To

Modified default file

<Directory/var/www/>

OptionsIndexesFollowSymLinksMultiViews

AllowOverrideall

Orderallow,deny

allowfromall

</Directory>

Then open Terminal and type

s u d os e r v i c ea p a c h e 2r e s t a r t

to restart the apache server. So, we have install and configure our server very skillfully. Start using your new server!

APACHE2

MOD_REWRITE

MYSQL

PHP

PHPMYADMIN

SERVER

URL REWRITE

ONE THOUGHT ON HOW TO SETUP WEB SERVER IN UBUNTU AND LINUX MINT
RickoDean
FEBRUARY 24, 2012 AT 10:23 PM

I am using Linux Mint 12 (derived from Ubuntu). I followed your instructions to install local server, when I tried to restart apache I got an error about hostname, I go in to change name to localhost. Then when I try to restart again, I get: restarting web server apache2 waiting [ok] When I open localhost from browser, it works but I am unsure if apache restarted successfully & or if the changes I made have been applied. Can you give me any input on if I have done this right or do I need to fix something? Kudos

Похожие интересы