Configure Apache server and Tomcat server on Ubuntu

Source: Internet
Author: User
Tags gz file

Configure Apache server on Ubuntu

1. Installing Apache

sudo apt-get install apache2

After the Apache installation is complete, the default Web site root directory is/var/www/html, which has a index.html file (entered in the browser: 127.0.0.1 or localhost can open the page)

2. Configuration files

Apache has two configuration files: apache2.conf (/etc/apache2/apache2.conf); and 000-default.conf (/etc/apache2/sites-available)

How to modify the Web site root directory: sudo vi/etc/apache2/apache2.conf, modify <Directory/var/www/>/var/www/in the new root directory (here I did not change)

sudo vi/etc/apache2/sites-available/000-default.conf, modify the location of the documentroot/var/www/html for the new root directory; Here I change it to/var/www/

3. Restart Apache:sudo/etc/init.d/apache2 restart

4. Test the success of changing the site root directory: Enter localhost or 127.0.0.1 in the browser

5. The content that the copy needs to access in the/var/www/directory, browser localhost can react

Configuring the Tomcat server on Ubuntu

1. Download tomcat:http://tomcat.apache.org/download-80.cgi

Download the tar.gz file, extract the command as: TAR-ZXVF tomcat.tar.gz

2. Configure Tomcat

1) Copy the extracted files to, opt directory: sudo cp-r tomcat8/opt

2) Enter CD/OPT/TOMCAT8, open the startup script: sudo vi startup.sh, add JDK and JRE as follows:

。。。

3) Start Tomcat:sudo. bin/startup.sh, where the corresponding JRE, Java information is displayed

4) Verify that the Tomcat installation was successful and entered in the browser: localhost:8080

5) Close Tomcat:sudo. bin/shutdown.sh

Configure Apache server and Tomcat server on Ubuntu

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.