Ubuntu server deployment issues

Source: Internet
Author: User
Tags nameserver

When you are new to Ubuntu server 12.04, you can choose to install it on a VM. The system is automatically installed. After the installation, I encountered a series of problems when starting the system. With the help of some netizens, I solved them one by one and kept updating them.

1. desktop environment Installation

Just entered the system and found that it was in the form of a command line. This is depressing. The command line is really difficult for people who are used to the window interface. With the help of a netizen, I found the command for installing the graphic interface. Ubuntu Series desktop actually has several desktop applications, including Ubuntu-desktop, kmeanut-desktop, and xubuntu-desktop. This document uses Ubuntu-desktop as an example to describe how to use this method.

Sudo apt-Get update // refresh the download list

Sudo apt-Get install Ubuntu-desktop // install graphical desktop

Or sudo aptitude install Ubuntu-Desktop

 

2. Install MySQL

Sudo apt-Get install mysql-server // install MySQL

Mysql_secure_installation // configure MySQL Security Settings

Sudo mysqladmin-H localhost-u root-p version // view the MySQL running status and version

It is very convenient to configure the MySQL database in versions earlier than ubuntu12.04. You only need to run three commands:

Sudo apt-Get install mysql-Admin

Sudo apt-Get install mysql-query-Browser

The MySQL database has been fully upgraded in Ubuntu 12.04. Therefore, you only need to execute two commands.

Sudo apt-Get install mysql-workbench

  

  Unable to remotely MySQL:

Enable remote authorization: Use the root user to log on to MySQL (MySQL-u root-p) locally, and then run grant all privileges on database. database object to username @ 'client ip' identified by 'Password'; (for example, grant all privileges on *. * To root @ '%' identified by '000000 ′;)

View port and IP: netstat-an | grep 3306

TCP 0 0 127.0.0.1: 3306 0.0.0.0: * listen

127.0.0.1 indicates that an IP address is bound and only local access is allowed (available in the following method); Listen indicates that the port is enabled.

Unbind an IP Address: in the/etc/MySQL/My. CNF file, bind-address is bound to 127.0.0.1, change it to the Ubuntu IP address, and save the modification.

Restart the database: Run/etc/init. d/MySQL restart to restart the MySQL service.

 

 

3. Install apache2

  apt-get install apache2// Install apache2. the default document root directory in Ubuntu is/var/WWW, And the configuration file/etc/apache2/apache2.conf is used,

4. Install PhP5

Apt-Get install PhP5 // install PhP5

  apt-get install Libapache2-mod-php5 // install PhP5 and Apache PhP5 modules

  /etc/init.d/apache2 restart// Restart Apache

5. Obtain MySQL support for PhP5

  apt-cache search php5// Check the PhP5 module first.

// Install the required modules, for example, the following command:

  apt-get install php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl

 

 

After installing lamp, we found that the original lamp environment can be installed with one click. After Linux Ubuntu is installed, use
Sudo apt-Get install tasksel
Sudo tasksel install lamp-Server

 

6. Configure the IP address

By default, IP addresses are allocated through DHCP. The following are static IP addresses.

VI/etc/Network/interfaces // set the IP address for opening the file, as shown below:

Auto eth0
Iface eth0 Inet DHCP // DHCP indicates automatic allocation,

Change

Auto eth0

# Iface eth0 Inet DHCP

        iface eth0 inet static
        address 192.168.80.129
        netmask 255.255.255.0
        gateway 192.168.80.2

Remember to restart the service after configuration takes effect:/etc/init. d/networking restart

7. Configure the DNS server

Vim/etc/resolv. conf // temporary configuration, expired after restart

Vim/etc/resolvconf/resolv. conf. d/base // permanent settings

Change the content of the above file:

Nameserver 192.168.80.2 // master
Nameserver 8.8.8.8 // standby

Remember to restart the service after configuration takes effect:/etc/init. d/networking restart

8. New users

Useradd is an elf executable program that adds a user name and creates a group name that is the same as the user name. However, it does not create a user name-based directory in the/home directory, you are not prompted to create a new password.

-B,-base-Dir base_dir specifies the base Directory of the Home Directory

-D,-home-Dir home_dir specifies the Home Directory

-G,-gid Group specifies GID

-L,-no-log-init do not add the user to the lastlog and faillog Databases

-M,-no-create-home do not create the Home Directory

-P,-Password specifies the password of the new user

-R,-system: Create a system account

-S,-shell specifies Shell

For example:Useradd-m-D/home/newuser-S/bin/bash-G Sudo-P newuser

Passwd newuser-- Change the password (ID newuser -- view group)

 

  

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.