Linux Practical problems

Source: Internet
Author: User

    1. When configuring Apache, execute the./configure--prefix=/application/apache2.2.17 to compile Apache, after make install completes, need user's access path more simple , need to give/ application/apache2.2.17 directory to do a soft link/application/apache, is the internal personnel can be accessed through/application/apache to the Apache installation directory/application /apache2.2.17 the content below , please give the implementation command. (There is a version number at the time of installation, it is more convenient to use later)

      Ln-s/application/apache2.2.17/application/apache

    2. It is known that Apache service access logs are logged by day in the server local directory/app/logs, due to disk space constraints, is now required to retain only the last 7 days of access logs, how can I resolve?

Method 1: Cover by week cycle. This Sunday log will overwrite the Sunday log.

Customlog "|/usr/local/sbin/cronolog/app/logs/access_www_%w.log" combined

Method 2: Use the Find method to remove, find seven days ago, delete

find/app/logs/-type-name "*.log"-mtime +7|xargs rm-f

find/app/logs/-type f-mtime +7-exec rm {} \; +7 means 7 days ago


650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/86/33/wKiom1e3zjLAdt1BAAKBfOkphi0951.png "title=" Snap1.png "alt=" Wkiom1e3zjladt1baakbfokphi0951.png "/>

3. When debugging the system service, want to be able to view the system log/var/log/messages update in real time, how to implement?

Tail-f/var/log/messages tail-f = Tailf viewing changes at the end of a file

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/86/33/wKioL1e345PhXr_MAADov_1uVOk178.png "title=" Snap3.png "alt=" Wkiol1e345phxr_maadov_1uvok178.png "/>

4. How do I change the line number and content of the nginx.conf content of the print configuration file? Nginx and Apache are different Web services software

View file (with line number) cat-n/etc/hosts or VI Edit input: Set Nu can also display line numbers


5. After loading the system, want to let the network File Sharing service NFS, only in the 3 level on the boot, how to implement?

Chkconfig--list sshd View the startup situation on each operating level of the SSHD service

Chkconfig--level 245 sshd off to turn off sshd service on level 245

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/86/34/wKiom1e36dLgW9yfAAHgibJhvUQ332.png "title=" Snap6.png "alt=" Wkiom1e36dlgw9yfaahgibjhvuq332.png "/>


6.linux Boot Process

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/86/33/wKioL1e36vfQ8ZT9AAKazzjsPWY525.png "title=" Snap7.png "alt=" Wkiol1e36vfq8zt9aakazzjspwy525.png "/>


7.linux Run Level

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/86/34/wKiom1e360TgRQXjAACUszxDz1U192.png "title=" Snap8.png "alt=" Wkiom1e360tgrqxjaacuszxdz1u192.png "/>


8.linux System View Chinese garbled, how to solve the garbled problem

Character set: A set of text symbols and their encodings. GBK fixed-length double-byte, not an international standard, a lot of support system. UTF-8 non-fixed length, 1-4 bytes, widely supported.

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/86/33/wKioL1e37CTQrs7oAADAoyq0bv8314.png "title=" Snap9.png "alt=" Wkiol1e37ctqrs7oaadaoyq0bv8314.png "/>650" this.width=650; "src=" http://s2.51cto.com/wyfs02/M00 /86/33/wkiol1e37itwbgusaafalujmz9k966.png "title=" Snap10.png "alt=" Wkiol1e37itwbgusaafalujmz9k966.png "/>


9. package files in the/etc directory. Package Command Tar ZCVF create a packaged file and compress files in a later directory

Tar zcvf etc.tar.gz/etc

To pack/etc/, pack the best CD to/etc (/etc/parent directory) Unzip command tar zxvf (tar XF)

Tar zxvf etc.tar.gz-c/tem/kkk Specify/TEM/KKK path decompression

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/86/35/wKiom1e4HO3ilYYkAAGIe-JnD3Q584.png "title=" Snap11.png "alt=" Wkiom1e4ho3ilyykaagie-jnd3q584.png "/>650" this.width=650; "src=" http://s2.51cto.com/wyfs02/ M02/86/35/wkiom1e4hy2qupebaakbhzvdwei116.png "title=" Snap12.png "alt=" Wkiom1e4hy2qupebaakbhzvdwei116.png "/> 650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/86/35/wKioL1e4HdCQE5KwAAFIB8IASdA715.png "title=" Snap13.png "alt=" Wkiol1e4hdcqe5kwaafib8iasda715.png "/>


10. Known 650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/86/35/wKioL1e4IMayIIcXAAAJEpdhIC0121.png "title=" Snap14.png "alt=" Wkiol1e4imayiicxaaajepdhic0121.png "/> The flyfly.txt and is strings that need to be filled with file FlyFly files

Command:cut-d ""-f3,6 flyfly.txt-f indicates the first few lines

[[email protected] mode]# cut-c 6-11,21-flyfly.txt -C means querying 6 to 11 21 characters by character

FlyFly 731652084

If the content is added a comma, still want to remove flyfly 731,650,284 more than a comma, the difficulty increases. With awk you can achieve

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/86/35/wKioL1e4JBPCsWx1AAE1Jk-jYtA112.png "title=" Snap15.png "alt=" Wkiol1e4jbpcswx1aae1jk-jyta112.png "/>


11 View/etc/services files How many lines of WC see the number of line bytes

Wc-l/etc/services

Cat-n/etc/services|tali-1

Sed awk grep can be achieved, we have to pay attention to their own thinking, the focus on thought.

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/86/35/wKiom1e4Jvvg8A_MAAD7x0IGnnE468.png "title=" Snap16.png "alt=" Wkiom1e4jvvg8a_maad7x0ignne468.png "/>

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/86/35/wKiom1e4KRHjGI7ZAACFh6qrclc180.png "style=" float: none; "title=" Snap17.png "alt=" Wkiom1e4krhjgi7zaacfh6qrclc180.png "/>

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/86/35/wKioL1e4KRLz9RhyAABhbADlysE012.png "style=" float: none; "title=" Snap18.png "alt=" Wkiol1e4krlz9rhyaabhbadlyse012.png "/>

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/86/35/wKiom1e4KRKz4C2TAADJEmcf72g816.png "style=" float: none; "title=" Snap19.png "alt=" Wkiom1e4krkz4c2taadjemcf72g816.png "/>

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/86/35/wKiom1e4KROTqUDGAABuIdb0cMM439.png "style=" float: none; "title=" Snap20.png "alt=" Wkiom1e4krotqudgaabuidb0cmm439.png "/>

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/86/35/wKioL1e4KRTCIABJAACHs7FmLBk965.png "style=" float: none; "title=" Snap21.png "alt=" Wkiol1e4krtciabjaachs7fmlbk965.png "/>

















This article is from the "11961592" blog, please be sure to keep this source http://11971592.blog.51cto.com/11961592/1840628

Linux Practical problems

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.