Linux practical configuration (UBUNTU)

Source: Internet
Author: User
Tags php mysql

1. software packages:

  • Apt-Get update -- run this command after modifying/etc/APT/sources. List or/etc/APT/preferences. In addition, you need to regularly run this command to ensure that your package list is up-to-date.
  • Apt-Get install packagename -- install a new software package (see aptitude below)
  • Apt-Get remove packagename -- uninstall an installed software package (keep the configuration file)
  • Apt-get-Purge remove packagename -- uninstall an installed software package (delete the configuration file)
  • Dpkg-force-all-Purge packagename some software is difficult to uninstall, and it can be used to block other software applications, but it is a little risky.
  • Apt-Get autoclean apt will back up installed or unloaded software on the hard disk, so if you need space, you can run this command to delete the software you have deleted.
  • The apt-Get clean command will also delete the backup of the installed software, but this will not affect the use of the software.
  • Apt-Get upgrade -- update all installed software packages
  • Apt-Get dist-upgrade -- upgrade the system to the new version.
  • Apt-cache search string -- search for strings in the package list
  • Dpkg-l package-name-pattern -- list all software packages that match the pattern. If you do not know the full name of the software package, you can use "* package-name-pattern *".
  • Aptitude-view installed or available software packages in detail. Similar to Apt-Get, aptitude can be called through the command line, but is limited to some commands-the most common commands are installation and uninstallation. Because aptitude knows more information than apt-get, it is more suitable for installation and uninstallation.
  • Apt-Cache showpkg pkgs -- displays the package information.
  • Apt-Cache dumpavail -- print the list of available packages.
  • Apt-Cache show pkgs -- displays Software Package records, similar to dpkg-print-avail.
  • Apt-Cache pkgnames -- print the names of all packages in the package list.
  • Dpkg-s file -- the package to which the file belongs.
  • Dpkg-l package -- list all files in the package.
  • Apt-file search filename -- search for software packages containing specific files (not necessarily installed). The file names contain specified strings. Apt-file is an independent software package. You must first install apt-Get install and then run apt-file update. If apt-file search filename outputs too much content, you can try to use apt-file search filename | grep-W filename (only show the names of the complete words in the specified string) or similar methods, such: apt-file search filename | grep/bin/(only files in folders such as/bin or/usr/bin are displayed. If you are looking for a specific execution file, this is helpful ).

* Apt-Get autoclean -- run this command regularly to clear the. Deb files of uninstalled software packages. In this way, you can release a large amount of disk space. If your requirements are urgent, you can use apt-Get clean to release more space. This command will delete the. Deb file that has installed the software package. In most cases, you will not use these. Debs files. Therefore, if you feel overwhelmed by insufficient disk space, this method may be worth a try.

2. Vim practical Configuration

In ubuntu, the vim configuration file is stored in the/etc/Vim directory. The configuration file name is vimrc.
In fedora, the vim configuration file is stored in the/etc directory. The configuration file name is vimrc.
Enter the following command on the terminal to edit the vimrc configuration file:
Sudo Vim/etc/Vim/vimrc
Or sudo gedit/etc/Vim/vimrc
2.1. display the row number
Add a new line at the end of the file and enter SET nu
2.2 syntax highlighting
Find "syntax on" in the file and remove the double quotation marks. Double quotation marks indicate the meaning of the comment.
2.3 automatic indent
Add a row at the end of the file and enter SET autoindent.
After adding a row, enter SET cindent
Autoindent indicates automatic indent, and cindent indicates automatic indent for C language syntax.

NOTE: If Vim does not take any action after the preceding settings are configured, upgrade Vim to the latest version. Generally, you only need to enter the following command on the terminal: sudo apt-Get install Vim

3. Clear the content of a file

 > B. LST/* clear the content of B. lst */
:> B. LST/* clear the content of B. lst */

4. Command screenshot

 import -window root hello.jpg
 

5. Modify the keyboard and other settings

 dpkg-reconfigure console-setup

6. Install PhP5 + apache2 + mysql5 + phpMyAdmin using apt-Get

Install PhP5 + apache2 + mysql5 + phpMyAdmin on Ubuntu

6.1 InstallationPHP,PhpMyAdmin

Use apt-Get for installation. Software packages to be installed include: PhP5, php5-dev, PHP-pear, php5-cli, php5-gd; phpMyAdmin.

6.2 InstallationApache2

Use apt-Get for installation. Software packages to be installed are: apache2, libapache2-mod-security, libapache2-mod-php5 (this module has been installed when PhP5 is installed)

6.3 InstallationMysql5

Use apt-Get for installation. Software packages to be installed are: mysql-server-5.0, libmysqlclient15-dev, php5-mysql

 

7. install Apache + PHP + MySQL + phpMyAdmin in Yum on centos 5.3

The online Yum installation in centos is slow. Replace the following with the centos image server in China!

Official image website of China: http://centos.ustc.edu.cn//* instructions for use */CD/etc/yum. repos. d [enter yum. repos. d directory] MV CentOS-Base.repo CentOS-Base.repo.save [modify source file name backup] wget http://centos.ustc.edu.cn/centos-base.repo.5 download music CentOS-Base.repo.5 CentOS-Base.repo [rename the downloaded file] 7.1. update the system kernel to the latest version. after the Yum-y Update (this step takes a long time, do not do it) system update, if the yum installation prompts an error message, run the following command to fix it. rpm-import/etc/pki/rpm-GPG/RPM-GPG-KEY * 7.2. install apahce, PHP, MySQL, and PHP to connect to the MySQL library component Yum-y insta Ll httpd PHP MySQL mysql-server PHP-mysql // install MySQL extension Yum-y install mysql-connector-ODBC mysql-devel libdbi-DBD-mysql // install PHP extension Yum- Y install PHP-Gd PHP-xml php-mbstring PHP-ldap php-pear PHP-XMLRPC // install Apache extension Yum-y install httpd-manual mod_ssl mod_perl mod_auth_mysql one-time paste installation: yum-y install httpd PHP MySQL mysql-server PHP-mysql httpd-manual mod_ssl mod_perl mod_auth_mysql PHP-mcrypt PHP-Gd PHP-XML Php-mbstring PHP-ldap php-pear PHP-XMLRPC mysql-connector-ODBC mysql-devel libdbi-dbd-mysql7.3. start service configuration/sbin/chkconfig httpd on [set Apache to self-start]/sbin/chkconfig -- add mysqld [add mysqld service to the System-view the situation, do not do]/sbin/chkconfig mysqld on [set mysqld to self-start]/sbin/service httpd start [start HTTPd service now]/sbin/service mysqld start [start mysqld service now] 7. 4. set the password of the root account of the MySQL database. Mysqladmin-u Root Password 'new password' [enter the password in quotation marks] to make the MySQL database more secure to copy content to the clipboard code: mysql-u root-P [This requires you to enter the password you just set, enter and press enter to MySQL> drop database test; [delete test database] mysql> Delete from MySQL. user where user = "; [deleting anonymous accounts] mysql> flush privileges; [reloading permissions] 7.5. firewall Configuration. add. allow access to port {21: FTP, 80: HTTP }. iptables-I RH-Firewall-1-INPUT-M State-State new-m tcp-p tcp-dport 21-J acceptiptables-I RH-Firewall-1-INPUT-M state-stat E new-m tcp-p tcp-dport 80-J accept is depressing. copy the above to notepad, change-state to lower-case, and then operate. otherwise, garbled characters will appear during pasting. b. disable firewall {not recommended }. service iptables stopc. reset and load the Firewall Service iptables restart7.6. install phpMyAdmin and go to phpMyAdmin to download the latest version. upload it to your website directory and configure it. You can do this in just a few steps. A. config. sample. inc. PHP is renamed config. inc. PHP; B. open config. inc. PHP file. Make the following changes; // $ cfg ['servers'] [$ I] ['controluser'] = 'pma '; // $ cfg ['servers'] [$ I] ['controlpass'] = 'pmapass '; // $ cfg ['servers'] [$ I] ['pmadb'] = 'phpmyadmin '; // $ cfg ['servers'] [$ I] ['bookmarktable'] = 'pma _ bookmark '; // $ cfg ['servers'] [$ I] ['relation'] = 'pma _ relation '; // $ cfg ['servers'] [$ I] ['table _ info'] = 'pma _ table_info '; // $ cfg ['servers'] [$ I] ['table _ coords '] = 'pma _ table_coords '; // $ cfg ['servers'] [$ I] ['pdf _ page'] = 'pma _ pdf_pages '; // $ cfg ['servers'] [$ I] ['column _ info'] = 'pma _ column_info '; // $ cfg ['servers'] [$ I] ['History '] = 'pma _ history '; // $ cfg ['servers'] [$ I] ['designer _ coords '] = 'pma _ designer_coords'; remove the // before each row; C. $ cfg ['blowfish _ secret'] = "; | modified to | $ cfg ['blowfish _ secret'] = 'http'; D. $ cfg ['servers'] [$ I] ['controluser'] = 'pma'; | modify 'pma' to your account | E. $ cfg ['servers'] [$ I] ['controlpass'] = 'pmapass'; | set 'pmapass to your MySQL logon password | f. $ cfg ['blowfish _ secret'] = "; | add a phrase password, for example, $ cfg ['blowfish _ secret'] = 'onohot '|
Related Article

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.