1.
Http://www.linuxidc.com/Linux/2016-10/136327.htm
2.
After installing the Ubuntu16.04, it is a blank Ubuntu. My goal is to build a lamp environment, and by the way, a Python django environment.
Basic Settings 1. Configure the network environment
The administrator assigns a static IP, so further configuration of the network environment is required
Configure DNS: Upper-Right network connection, edit link, wired connection 1->ipv4 settings->dns server:202.112.80.106-> Save
Login Gateway : For campus network users, login gateway to access the external network
Test :ping www.baidu.com
2. Set the root password
sudo passwd
3. Update the source
sudo apt-get update
The files saved by the source are:/etc/apt/sources.list
Install common software 1. Ssh
sudo apt-get install openssh-server
View status :service ssh status/start/stop/restart
Or:/etc/init.d/ssh status/start/stop/retsrt
In fact, the service command executes the/ETC/INIT.D script, which is the same function
2.Vim
sudo apt-get install vim
3.Tree
sudo apt-get install tree
4.Git
sudo apt-get install git
Build LAMP1. Install Apache
sudo apt-get install apache2
Test : Browser Access http://Ubuntu的IP
, the It works! Web page appears.
View status :service apache2 status/start/stop/restart
Web Directory :/var/www
installation directory :/etc/apache2/
Global Configuration :/etc/apache2/apache2.conf
Listening Port :/etc/apache2/ports.conf
Virtual Host :/etc/apache2/sites-enabled/000-default.conf
2. Install MySQL
sudo apt-get install mysql-server mysql-client
3. Install PHP
sudo apt-get install php7.0
4. Install additional modules
sudo apt-get install libapache2-mod-php7.0
sudo apt-get install php7.0-mysql
5. Modify Permissions
sudo chmod 777 /var/www
6. Installing phpMyAdmin
sudo apt-get install phpmyadmin
Install : Select Apache2, click OK. The next option is to configure the database and enter the password.
To Create a phpmyadmin shortcut :sudo ln -s /usr/share/phpmyadmin /var/www/html
To enable the Apache mod_rewrite
module :sudo a2enmod rewrite
Restart Service :
Test : Browser access:http://ubuntu地址/phpmyadmin
7. Configure Apache
vim /etc/apache2/apache2.conf
Install Python package 1.pip
sudo apt-get install python-pip
2.Django
pip install django
Test :import django
# #3. Mysql-python
pip install MySQL-python
Test :import MySQLdb
FAQ 1. Secure SSH Client Connection error
-
error : Algorithm negotiation failed
-
Resolve :
ciphers Aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr,3des-cbc,arcfour128,arcfour256,arcfour, Blowfish-cbc,cast128-cbcmacs hmac-md5,hmac-sha1,[email protected],hmac-ripemd160,hmac-sha1-96, Hmac-md5-96kexalgorithms DIFFIE-HELLMAN-GROUP1-SHA1,DIFFIE-HELLMAN-GROUP14-SHA1, diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384, Ecdh-sha2-nistp521,diffie-hellman-group1-sha1,[email protected]
2.Xshell or Xftp Chinese garbled
Xshell: End-of-file, properties---->utf-8>
xftp: Options----Properties, file--with UTF-8 encoding
3. Error installing MySQL
The following packages have unsatisfied dependencies:
Mysql-client: Dependent: mysql-client-5.5 But it will not be installed
Mysql-server: Dependent: mysql-server-5.5 But it will not be installed
E: The error cannot be corrected because you require certain packages to remain current, that is, they destroy the dependencies between the software packages.
4. Error installing PIP
workaround : You can use the following command instead:
sudo apt-get install python-pip python-dev build-essential
sudo pip install --upgrade pip
sudo pip install --upgrade virtualenv
5. Installing the Django Super-times error
6. Installation Mysql-python Error
7. Updating the Python library
pip install --upgrade 库名
This article permanently updates the link address : http://www.linuxidc.com/Linux/2016-10/136327.htm
Ubuntu 16.04 Build Lamp development environment