0% found this document useful (0 votes)
9 views1 page

Install Apache, MySQL, PHP on Linux

The document provides a step-by-step guide for installing and configuring Apache Web Server, MySQL, and PHP on a local Linux machine. It includes commands for installation, setting up the MySQL environment securely, and configuring Apache to prioritize PHP files. The document concludes with instructions for testing PHP processing on the web server by creating an info.php file.

Uploaded by

B Shirisha
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views1 page

Install Apache, MySQL, PHP on Linux

The document provides a step-by-step guide for installing and configuring Apache Web Server, MySQL, and PHP on a local Linux machine. It includes commands for installation, setting up the MySQL environment securely, and configuring Apache to prioritize PHP files. The document concludes with instructions for testing PHP processing on the web server by creating an info.php file.

Uploaded by

B Shirisha
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

CNWT LAB MANUAL

PROBLEM STATEMENT: Install the following on local machine Apache Web Server Install MySQL Install
PHP and configure it to work with apache web server and MySQL Tomcat Application Server Locally AIM:
Installing and configuring Apache web server, MySQL with PHP in Linux Environment PROCEDURE:
Step1: Install Apache Web server $ sudo apt-get update $ sudo apt-get install apache2 To verify the
installation use the following statement [Link] or [Link] OUTPUT:
Step2: Installation of mysql server $ sudo apt-get install mysql-server php5-mysql During the installation,
your server will ask you to select and confirm a password for the MySQL "root" user. This is an
administrative account in MySQL that has increased privileges. Think of it as being similar to the root
account for the server itself (the one you are configuring now is a MySQL-specific account however).
When the installation is complete, we need to run some additional commands to get our MySQL
environment set up securely. First, we need to tell MySQL to create its database directory structure
where it will store its information. You can do this by typing: $ sudo mysql_install_db Run a security
script that will remove some dangerous defaults and lock down access to our database system a little
bit. $ sudo mysql_secure_installation Enter the password you set for the MySQL root account. Next, it
will ask you if you want to change that password. If you are happy with your current password, type "n"
for "no" at the prompt. For the rest of the questions, you should simply hit the "ENTER" key through
each prompt to accept the default values. Step3: Installation of PHP $ sudo apt-get install php5
libapache2-mod-php5 php5-mcrypt Testing the PHP: if a user requests a directory from the server,
Apache will first look for a file called [Link]. We want to tell our web server to prefer PHP files, so
we'll make Apache look for an [Link] file first. To do this, type this command to open the [Link] file
in a text editor with root privileges: $ sudo nano /etc/apache2/mods-enabled/[Link] DirectoryIndex
[Link] [Link] [Link] [Link] [Link] [Link] The above code need to be replace by the
following code: DirectoryIndex [Link] [Link] [Link] [Link] [Link] [Link] Save and
close the file by pressing "CTRL-X". Restart the apache server $ sudo service apache2 restart Test PHP
Processing on your Web Server :( Create a file [Link]) In order for Apache to find the file and serve it
correctly, it must be saved to a very specific directory, which is called the "web root". In Ubuntu 14.04,
this directory is located at /var/www/html/. We can create the file at that location by typing: $ sudo
nano /var/www/html/[Link] This will open a blank file. put the following text, which is valid PHP code,
inside the file: save and close the file. The address you want to visit will be:
[Link] EX:

You might also like