centos 6.5 LAMP

貌似靠谱(主要centos默认有httpd,是否需要将其remove然后再安装啊,我采用到方法是没有安装,直接用的默认的),大致就是这个样子吧----zz

LAMP is a combination of operating system and open-source software stack. The acronym LAMP is derived from first letters of Linux, Apache HTTP Server, MySQL database, and PHP/Perl/Python.

In this tutorial let us see how to setup LAMP server on RHEL/CentOS/Scientific Linux 6.x. Here x stands for version such as 6.1, 6.2, 6.3, 6.4, 6.5 etc.

My testbox hostname and IP address are server.unixmen.local and 192.168.1.101/24, respectively.

Install Apache

Apache is an open-source multi-platform web server. It provides a full range of web server features including CGI, SSL and virtual domains.

To install Apache, enter the following command from your terminal:

Start the Apache service and let it to start automatically on every reboot:

Allow Apache server default port 80 through your firewall/router if you want to connect from remote systems. To do that, edit file /etc/sysconfig/iptables,

Add the following lines.

Restart iptables:

Test Apache:

Open your web browser and navigate to http://localhost/ or http://server-ip-address/.

Apache HTTP Server Test Page powered by CentOS - Mozilla Firefox_001

Install MySQL

MySQL is an enterprise class, open source, world’s second most used database. MySQL is a popular choice of database for use in web applications, and is a central component of the widely used LAMP open source web application software stack.

To install MySQL, enter the following command:

Start the MySQL service and make to start automatically on every reboot.

Setup MySQL root password

By default, mysql root user doesn’t has password. To secure mysql, we have to setup mysql root user password.

Install PHP

PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely used open-source general purpose scripting language that is especially suited for web development and can be embedded into HTML.

Install PHP with following command:

Test PHP

Create a sample “testphp.php” file in Apache document root folder and append the lines as shown below:

Add the following lines.

Restart httpd service:

Navigate to http://server-ip-address/testphp.php. It will display all the details about php such as version, build date and commands etc.

 

If you wanna to get MySQL support in your PHP, you should install “php-mysql” package. If you want to install all php modules just you use the command “yum install php*”

Now open the phptest.php file in your browser using http://ip-address/testphp.php or http://domain-name/testphp.php. Scroll down and you will see the mysql module will be presented there.

phpinfo() - Mozilla Firefox_002Install phpMyAdmin

phpMyAdmin is a free open source web interface tool, used to manage your MySQL databases. By default phpMyAdmin is not found in CentOS official repositories. So let us install it using EPEL repository.

To install EPEL repository, follow the below link:

- Install EPEL Repository On RHEL/CentOS/Scientific Linux 6

Now install phpMyAdmin

Configure phpMyAdmin

Edit the phpmyadmin.conf file.

Find and comment the whole /<Directory> section as shown below:

Open “config.inc.php” file and change from “cookie” to “http” to change the authentication in phpMyAdmin:

Change cookie to http.

Restart the Apache service:

Now you can access the phpmyadmin console by navigating to http://server-ip-address/phpmyadmin/ from your browser.

Enter your MySQL username and password which you have given in previous steps. In my case its “root” and “centos”.

phpMyAdmin - Mozilla Firefox_003Now you will be redirected to the phpmyadmin dashboard.page as shown below.

192.168.1.101 - localhost | phpMyAdmin 4.1.2 - Mozilla Firefox_004

Now you will able to manage your MariaDB databases from phpMyAdmin web interface.

That’s it. Your LAMP server is up and ready to use.

Cheers!

转载于:https://www.cnblogs.com/shanyangmanbu/p/3749306.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值