How to build a website on a linux server

How to build a website on a linux server

I'm Ai Xi, and today is the time to share some knowledge about server system operation with friends who want to learn Linux system.

In this article, Aixi will tell you how to use the Linux system to build a website. The website is a display page, which is used for commercial bulletin boards, facades, and points that are easy for users to remember. Through the website, you can learn more about your company. So how to build a website on the server of the linux system, follow the operation of Aixi below:

Preparation: one server, website files, domain name

Server environment configuration

Install the Ubuntu 16 64 system, and the system will install it automatically. Several kinds of software are mainly used to build a small website: jdk, tomcat, mysql, pagoda, there are many ways to build a website depending on personal habits

jdk installation and configuration

Get jdk command:

wget

xxxx://download.oracle.com/otn-pub/java/jdk/8u161-b12/2f38c3b165be4555a1fa6e98c45e0808/jdk-8u161-linux- x64.tar.gz

After the download is complete, move to the specified directory, such as /usr/java/ (create the java/ directory) and unzip it

tar -zxvf  jdk-8u161-linux- x64.tar.gz

Configure jdk

Execute vim /etc/profile to edit the system configuration file, and add the following code at the end of the file:

export JAVA_HOME=/usr/local/jdk-8u161

export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

export PATH=$JAVA_HOME/bin:$PATH

Execute refresh configuration

source  /etc/profile

2. tomcat configuration

Use the wget command to download the tomcat package, and use the tar name to decompress it.

Enter the bin directory and execute ./startup.sh to start tomcat

Execute ./shutdown.sh to shut down tomcat.

Execute ./catalina.sh run to see the running information of the server in the current terminal. The developed web program is directly placed in the webapp directory. By default, tomcat will automatically scan or decompress.

3. Database configuration

 Directly execute the following code under Ubuntu for automatic installation, and you must not forget to set the password in the step of prompting for a password during the installation process:

sudo apt-get install mysql-server

sudo apt-get isntall mysql-client

sudo apt-get install libmysqlclient-dev

Check if the installation was successful:

sudo netstat -tap | grep mysql

After the installation is successful, log in to the mysql server:

mysql -u root -p 

You can use it after entering the password

Pagoda panel build website:

Prepare a server with a pure system to install the pagoda panel configuration environment

Debian installation script

wget -O install.sh http://download.bt.cn/install/install-ubuntu_6.0.sh && bash install.sh 1ba5f33df

After entering the above mount command, press Enter to start the download. When Do you want to install Bt-Panel to the /www directory now? (y/n) appears

Enter y and press Enter to perform online installation.

Wait patiently until the following interface appears, indicating that the installation is successful.

Finally, there will be: (pagoda management address)

External network panel address : http://xxx.xxx.xxx.xxx:xxxxx/ a group of random numbers

Intranet panel address: http://xxx.xxx.xxx.xxx:xxxxx/ a group of random numbers

(username) username: ( this is the username will appear a string of alphanumeric combinations ) random

(password) password: ( this is the password will appear a string of alphanumeric combinations ) random

After accessing the generated account and password through the external network panel address and installing the website environment, two environment options, LNMP and LAMP, will pop up. Personally, I suggest choosing LNMP for one-click installation.

Find the website on the left side of the pagoda panel --- add a website --- fill in your domain name --- select the website file path --- click create (you don't need to choose the default for others)

If you open the website access, the following picture will be displayed

That is, delete the original html file in the website file, and change the htm suffix name of your own website file to html.

If you can’t open the website directly, remember to check whether the server port is open or not

After completing the above steps, a simple web server configuration is complete, start your web development journey

I'm Essie, that's all for today's sharing, see you next time!

Join hands with Chiwang to escort you on the network road

Guess you like

Origin blog.csdn.net/V13807970340/article/details/130171789