Aliyun Ubuntu14.04 Deployment LAMP + installation Thinksns

Source: Internet
Author: User
Tags curl php and mysql phpinfo ssh administrator password phpmyadmin aliyun

This article refers to a variety of documents, summarized and written. There are other people's methods, but also have their own thinking.

Remember that installation Thinksns encountered some problems, found that there is no relevant systematic article, write an introduction to their own methods, if I help you, I am also honored.

Problems that may be encountered:

1, your server does not install this PHP extension: curl, please see the 7.1 steps

2, after installation, access to the index page HTTP Error 500 errors, this question please see step


1. Update the software source

sudo  apt-get update


2. Install Apache

sudo apt-get  install apache2


3. See if Apache is installed successfully

Apache2–v


As shown below, indicates that the build was successful


4. Access to the server's IP through the browser, if the Apache welcome interface, indicating the success of the installation, as follows:

5. Install PHP5

sudo apt-get install php5


6. View the PHP5 version

Php5–v


Indicates that the PHP5 has been successfully installed.


7. See if Apache has loaded the libphp5.so module


This module is Apache used to command the PHP parser to execute PHP code.

Cat/etc/apache2/mods-enabled/php5.load




Indicates that the module is already loaded


7.1 Installing curl, this is my own problem.

First enter
Apt-cache search Curl | grep php
Query curl PHP support name
may return the following:
php5-curl-curl module for PHP5
installation:
sudo apt-get install php5-curl restart
Apache
sudo/etc/init.d/apache2 Restart



The following is history, installed to solve your server did not install this PHP extension: curl ... The problem of Failed


8. Install MySQL


The installation process will allow the input database root password, two input can continue to install to complete, note that this password is not the system root account password, but you installed the database default user root password

sudo apt-get install Mysql-server


9. Check to see if the mysql.so extension has been loaded


PHP performs the curd operation through the extended link MySQL, if you are prompted no such file or directory indicates that PHP does not have an extension of the operation database installed by default, you need to install it yourself

Cat/etc/php5/mods-available/mysql.ini,


10. If the previous step is unsuccessful, perform this step and install the MySQL extension to PHP
(if not installed may be wrong in the Thinksns installation times)

sudo apt-get install Php5-mysql



11. See if the extension is successful and different versions may be stored in different locations

Cat/etc/php5/mods-available/mysql.ini


Indicates that the mysql.so extension has been successfully installed.


11.2 Thinksns When you click Install on the page, The database extension supports a problem.

Then follow the same approach as follows.

Remove MySQL

sudo apt-get autoremove--purge mysql-server-5.0
sudo apt-get remove mysql-server
sudo apt-get autoremove Mysql-server
sudo apt-get remove Mysql-common//This is important.


Some of the above are actually superfluous.


clean up residue data

Dpkg-l |grep ^rc|awk ' {print $} ' |sudo Xargs dpkg-p



installing MySQL

sudo apt-get install mysql-server
sudo apt-get install mysql-client
sudo apt-get install php5-mysql 
// Install php5-mysql is to connect PHP and MySQL
once the installation is complete, the MySQL server should start automatically. You can run the following command at the terminal prompt to check if the MySQL server is running:
sudo netstat-tap | grep MySQL



When you run the command, you can see a line similar to the following:

TCP 0 0 Localhost.localdomain:mysql *:* LISTEN-


If the server does not function correctly, you can start it by using the following command:

Sudo/etc/init.d/mysql restart


Enter MySQL

$mysql-uroot-p Administrator Password


To configure the administrator password for MySQL:

sudo mysqladmin-u root password newpassword



12. Restart MySQL and Apache

sudo service mysql restart
 sudo service apache2 restart


13. Create a PHP file to test whether the environment is installed successfully,

cd/var/www/html
vim info.php
php file content:
echo mysql_connect (' localhost ', ' root ', ' 123456 ')? "Success"    : "Fail";
Echo Phpinfo ();


Note that you must use the LocalHost address as the address for the test database connection, because so far we have not opened the MySQL Remote Connection account service.


14. Access the file ip/info.php see if the connection was successful




Indicates a successful connection, so far our PHP and MySQL as well as Apache have been installed and configured to work properly.


15. Install common extensions for PHP

This is a very important step.

sudo apt-get install php5-gd Curl libcurl3 Libcurl3-dev


The process of installation time is longer, please wait patiently;


16. Restart Apache after Setup is complete

sudo service apache2 restart


17. Back to the browser info.php refresh


See if the expansion has just been installed to be loaded, search Gd,curl, etc., if just installed successfully, should be able to display in the phpinfo has been loaded;


18.SSH upload file


If you need to upload or manipulate files, you need to use the root account for SSH login, you need to modify the Ubuntu system to allow root user ssh login,

cd/etc/ssh/ 
sudo vim sshd_config
 : Set nu
 28G
find permitrootlogin change to Yes save exit, restart SSH service, you can use the root account login.
sudo service ssh restart



18.1 Uploading files using WINSCP


Use WINSCP upload Thinksns, the same SSH transmission, online tutorials a lot, do not say, just and the above steps are not the same, explain.

Give a hyperlink to a WINSCP


19. Install phpMyAdmin (preferably installed, easy to operate, and set up the following remote login account)

sudo apt-get install phpMyAdmin


During the installation, you will be prompted to enter a password, and so on, the direct input can be installed after the default placed in the/usr/share/phpmyadmin directory, in order to enable us to access through the web, here need to establish a soft connection to the default directory of Apache

sudo ln-s/usr/share/phpmyadmin/var/www/html/pma


Here we have established a PMA soft connection pointing to the actual phpMyAdmin directory.


20. Direct access to phpMyAdmin in the browser, enter IP/PMA as follows:

Enter User name password login entry.


21. Open MySQL Remote access permission

sudo  vim/etc/mysql/my.cnf


Find Bind-address, comment it out, save exit, then log on to phpMyAdmin, create a new user in the permissions, as follows:

Finally restart the MySQL service

sudo service MySQL restart


This is a remote connection tool such as navicat to connect MySQL, so far, a simple lamp environment has been built successfully.


22 Error accessing the index page HTTP Error 500 if the installation Thinksns succeeds


My solution is relatively simple and rough, directly to the entire Site Directory permissions to 777

Chmod-r 777 XXX
The experimental nature of the project, if it is the production environment can not be so.


Reference Documentation:

Ubuntu14.04--Install lamp--Aliyun test Host

Http://www.linuxidc.com/Linux/2015-03/115136.htm

Ubuntu Installation Php-curl Expansion

Http://blog.sina.com.cn/s/blog_560261250101d7yp.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.