设为首页 收藏本站
查看: 827|回复: 0

ubuntu 13.10 LAMP + PhpMyAdmin 配置

[复制链接]

尚未签到

发表于 2015-11-15 14:50:04 | 显示全部楼层 |阅读模式
  


  



1、安装 LAMP
  文章地址: http://www.unixmen.com/install-lamp-server-apache-mysql-php-ubuntu-13-10-server/


Install LAMP Server (Apache, MySQL Or MariaDB, PHP) On Ubuntu 13.10 Server


WRITTEN BY sk ON OCTOBER
21, 2013. POSTED IN linux
tutorials, ubuntu



Last
Updated on 05 November 2013


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
orPython. We already have shown you how to install LAMP on many platforms.




In this tutorial, let us install LAMP server on Ubutu 13.10 Server edition. My testbox hostname and IP address are server.unixmen.com 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:

sudo apt-get install apache2


Test Apache:

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

Install
MySQL

MySQL is a relational database management system (RDBMS) that runs as a server providing multi-user access to a number of databases, though SQLite probably has more total
embedded deployments

sudo apt-get install mysql-server mysql-client

During installation, you’ll be asked to setup the MySQL root user password. Enter the password and click Ok.

Re-enter
the password.

Now
MySQL server has been installed.

You can verify the MySQL server status using command:

sudo service mysql status

Sample output:

mysql start/running, process 3901

Note: If you want to use MariaDB instead of MySQL, then follow these
steps to install MariaDB on Ubuntu 13.10 server.

Install MariaDB


MariaDB is a drop in replacement for MySQL. It is a robust, scalable and reliable SQL server that comes rich set of enhancements.

First you have to remove existing MySQL packages if any. To completely uninstall MySQL with configuration files, enter the following command:

sudo apt-get purge mysql*

Run the following command to remove unwanted packages.

sudo apt-get autoremove

Now add MariaDB PPA to install it.

Run the following commands to add PPA.

sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
sudo add-apt-repository 'deb http://mariadb.biz.net.id//repo/5.5/ubuntu saucy main

Update the software sources list and install MariaDB using following commands:

sudo apt-get update
sudo apt-get install mariadb-server mariadb-client

During installation you will be asked to set mysql ‘root’ user password.

Re-enter
password:

You
can check the MariaDB version using command:

mysql -v

Sample output:

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 34
Server version: 5.5.33a-MariaDB-1~raring-log mariadb.org binary distribution
Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.
Reading history-file /home/sk/.mysql_history
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

Check if mariadb is running or not, using the following command:

sudo service mysql status

Sample output:

* /usr/bin/mysqladmin  Ver 9.0 Distrib 5.5.33a-MariaDB, for debian-linux-gnu on i686
Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.
Server version        5.5.33a-MariaDB-1~raring-log
Protocol version    10
Connection        Localhost via UNIX socket
UNIX socket        /var/run/mysqld/mysqld.sock
Uptime:            1 min 53 sec
Threads: 1  Questions: 550  Slow queries: 0  Opens: 314  Flush tables: 4  Open tables: 22  Queries per second avg: 4.867

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:

sudo apt-get install php5 php5-mysql libapache2-mod-php5


Test PHP

Create a sample “testphp.php” file in Apache document root folder.

sudo nano /var/www/testphp.php

Add the following lines.

<?php
phpinfo();
?>

Restart apache2 service:

sudo service apache2 restart


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 want to install all php modules, enter the command sudo apt-get install php* and restart the apache2 service. To verify for the modules, open web browser and navigate
to http://server-ip-address/testphp.php. You will able to see all php modules.


Manage MySQL Databases (Optional)

Install phpMyAdmin:



phpMyAdmin is a free open-source web interface tool used to manage your MySQL databases. It is available in the Official Debian repositories. So install it with command:

sudo apt-get install phpmyadmin


Select the Web server you use, in my case it is apache2.

Select
Yes to configure database for phpmyadmin wjth dbconfig-common.

Enter
password of the database’s administrative user.

Enter
MySQL application password phpmyadmin.

Re-enter
the password.

The
phpMyAdmin installation has been completed.

Access phpMyAdmin Web Console



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 “ubuntu”.

You
will be redirected to PhpMyAdmin main web interface.

Now
you can manage your MySQL databases from phpMyAdmin web interface.

That’s it. Your LAMP server is up and running now

.






2、配置phpmyadmin



按照上面的说明安装phpmyadmin后往往不能正常工作,需要配置一下,网上的解决方式大多是旧版本的。新版本的解决方式可以在ubuntu网站找到。

地址:https://help.ubuntu.com/community/phpMyAdmin


Once phpMyAdmin is installed point your browser to
http://localhost/phpmyadmin to start using it. You should be able to login using any users you've setup in MySQL. If no users have been setup, useadmin with no password to login.

Should you get a 404 &quot;Not Found&quot; error when you point your browser to the location of phpMyAdmin (such as:http://localhost/phpmyadmin) the issue is likely
caused by not checking the 'Apache 2' selection during installation. To redo the installation run the following:

sudo dpkg-reconfigure -plow phpmyadmin

Then select Apache 2 for the webserver you wish to configure.

If this does not work, then you can do the following to include the phpMyAdmin-shipped Apache configuration into Apache:

sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf.d/phpmyadmin.conf
sudo /etc/init.d/apache2 reload


  • Since Ubuntu 13.10 (Saucy Salamander), Apache no longer loads configuration files from the /etc/apache2/conf.d directory. Instead, they are loaded from the /etc/apache2/conf-enabled directory. Therefore, if you need to manually include the phpMyAdmin-shipped
    Apache configuration file, you must run the following:



sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-enabled/phpmyadmin.conf
sudo /etc/init.d/apache2 reload










  

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-139571-1-1.html 上篇帖子: LAMP环境搭建,从0开始。 下篇帖子: LAMP/DAMP环境配置(Debian+Apache2+Mysql+php5)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表