Current location - Education and Training Encyclopedia - Education and training - Linux server building tutorial video Linux server building tutorial
Linux server building tutorial video Linux server building tutorial
How to build a website on your own linux server?

First, you need to have the basic knowledge of linux system, install web service components such as LAMPLNMPTengine on linux system, then you need to have the basic knowledge of front/back-end languages such as htmlphpcssjs to prevent the website code from being accessed on the established web server, and finally register a domain name for domain name resolution.

How to build a linux mail server?

It can be built directly with centos version of U-Mail server, and the system is very stable. Installation is very simple. If you don't understand, you can directly find technical support to help you install it. You can download the trial version of R.

How to configure web server under linux?

Tools/raw materials

Linux operating system

Detailed description of Web server configuration

Methods/steps

1.Apache is a Web server under Linux. Apache uses static pages and needs to load modules to support dynamic pages. It will dynamically adjust the process in real time. It makes the best use of multi-core CPU resources and supports virtual host applications. Multiple websites * * * share an IP address.

Install Web services

Install the Web service first, and then install it by the command yumgroupinstall. It is recommended to use groupinstall instead of install, because it will install all related service packages of the service together, so there will be no loss.

2. Start the service through servicehttpdrestart. The reason to use restart instead of start here is that it is safer, because we don't know whether the service has been started. If it has been started, using start again may cause unexpected problems, so we use restart here.

3. Opening the httpd service through the command chkconfighttpdon is still valid after the next boot. The advantage of this is that by setting the auto-start service, man-made wrong operation is avoided, and at the same time, the service will still be opened after the computer is restarted or shut down.

4. Verify whether the httpd service is started normally and whether external services can be provided. Go to /var/www/html/, here is the main website, write a simple page, and then redirect to index.html, which is the default home page. Access the service through http, and find that the site has been successfully served.

5. You can modify the httpd configuration file through the command vim/etc/httpd/conf/httpd.conf, or you can use the functions in the configuration file. Some functions are marked with #. If you want to use this function, you can directly delete # to make the built-in configuration file take effect.

6. Through the command ll/etc/httpd, you can see that there are directory files of conf and conf.d in this directory. Further look at//etc /etc/httpd/conf.d The files you can see below are all module files of httpd to support dynamic pages.

7. For the relationship between 7. Apache and Selinux, enter the /var/www/html/ directory, check the index.htmlSelinux attribute in the directory through ll_Z, and check the process of httpd through the command ps_auxZ|grephttp. These http processes all have the Selinux context attribute of httpd _ t. Selinux stipulates that the process context attribute such as http_t can access the context attribute of files such as httpd_sys_content_t, thus ensuring that the content of the website can be accessed.

8. Check the Apache log information, which is stored in the /var/log/httpd/ directory. You can view http access logs and https access logs, and you can view http logs and https error logs of errors.

Teach you how to build a linux server step by step.

Deployment, configuration and construction steps of Linux server:

1. Ready:

1. 1 . JDK 1.8:JDK-8u 1 1-Linux-x64 . tar . gz .

Tomcat:Apache-Tomcat-8 . 0 . 39-windows-x64 . zip .

1.2. Install a 1.8 jdk first, and pay attention to linuxforjdk, otherwise it won't work.

Then create a new java folder under /usr/ in the root directory (the root directory here should be accessed by cd first and then /usr/ instead of home/xxx, and you can view the current path through pwd)/usr/ to place the extracted jdk file). Here, because the suffix is tar.gz, you can directly decompress it with tar-xf command.

2. Configuration:

2. 1. Configure the environment variables of JDK: Go to the /etc/ folder to find the configuration file, and add variable parameters at the end of the file through the file editing command viprofile:

JAVA _ HOME =/usr/JAVA/JDK 1 . 8 . 0 _ 1 1

PATH=$JAVA_HOME/bin:$PATH

Classpath =. :$ JAVA _ HOME/JRE/lib/rt . jar:$ JAVA _ HOME/lib/dt . jar:$ JAVA _ HOME/lib/tools . jar

2.2. Unzip the downloaded tomcat to a custom folder, mine is home/pengyy/tomcat/, change the port number in the configuration file, and edit server.xml with vi command. Later, when the port of 8005 was in conflict, I changed it to 8088 directly, and then changed the port requested by http to 800 1. Ok, tomcat configuration is complete.

2.3. Make a completed web project into a war package and decompress it in webapps under tomcat.

2.4. Enter the bin directory under tomcat and enter the command to start:. /start.sh and terminate the command. /shutdown.sh ..

You can view the log, go to tomcat's logs directory to view the catalina.out log file, you can view the file through the cat command, and you can also view it through tail-f (how many rows can be counted backwards) catalina.out.

If the port number is occupied, you can use the command lsof-i: port number to check the process number where the port number is occupied, or stop the process or modify the port number of tomcat.

And when you are not sure whether to terminate a project, you can check whether there is a running project by entering the command ps-ef|grepjava, and you can kill a running project by killing-9 process number.

Finally, the ip address of the virtual machine is obtained through ifconfig or Ip command, and accessed on the host through ip+ port number+project root path.