Installer Serveur Web Apache Ubuntu

Posted on by

So I have decided to build a Ubuntu computer, for now I am going to dual boot with Win7, and then install apache web server. Figured I would give the whole web thing. In this How-To, we install LAMP on an Ubuntu 16.04 Server. LAMP is a simple software bundle made of 4 components, Linux, Apache, MySQL, and PHP. Linux the core of the platform, in this case, we are using Ubuntu 16.04. Apache is the web server, majority of the web servers in the world are running Apache MySQL is a.

Installer Apache Linux

The Apache HTTP server is a mighty beast that powers the majority of websites. It has evolved into a complex server that slices, dices, dances, and sings.

It powers vast hosting centers, and it is also splendid for running small personal sites. The trick with Apache is knowing which configurations you need as it has plenty to choose from. We'll start with setting up a single site, and then in part 2 set up SSL, which is vitally important, and we'll learn a bit about the.htaccess file. Yes,.htaccess, that wonderful file that allows us to make per-directory configurations, but which uses such a contorted syntax it reduces the most stoic server admin to tears and whimpers.

The good news is you never need to use.htaccess if you have access to your Apache configuration files. But when you don't, for example on shared hosting, you need.htaccess. In this series we'll tackle Debian/Ubuntu/Mint and Fedora/CentOS/Red Hat separately, because the various Linux families are all special flowers that feel they must organize the Apache configuration files in their own unique ways.

On Debian/etc. Install Apache with this command: $ sudo apt-get install apache2 This installs Apache, utilities, configuration files, and other items you can see with apt-cache show apache2. Debian/Ubuntu start Apache automatically after installation. Point your web browser to to verify that it's running; you should see the default index page (Figure 1). When you see this you're ready to put it to work. Where is Everything Configuring Apache appears complex at first, but when you study the configuration files you see a nice modular scheme that makes it easy to manage your configurations.

The configuration files are in /etc/apache2. Spend some time studying your configuration file structure and reading the default configuration files. You should have these files and directories: apache2.conf conf-available conf-enabled envvars magic mods-available mods-enabled ports.conf sites-available sites-enabled The main server configuration file is /etc/apache2/apache2.conf. You won't spend much time editing this file as it ships with a complete configuration, and it calls other configuration files for the bits you need to customize.

Look in here to see the location of server configuration files, your HTTP user and group, included files, log file locations, and other global server configurations. Conf-available contains additional server configurations.

Keep any additional global configurations in this directory, rather than adding them to apache2.conf. Mods-available contains configurations for all installed modules.

Sites-available contains configurations for your virtual hosts. Even if you're running only a single site you will set it up in a virtual host configuration. None of the configurations in these directories are active until they are symlinked to their respective *-enabled directories. You must use Apache commands to set up new sites correctly, which we will get to in the next section. Envvars contains Apache's environment variables. Magic has file MIME types, so that Apache can quickly determine the file type from its first few bytes.

Ports configures the TCP ports that Apache listens to. Single Site The installation comes with a default site that is configured in sites-available/000.default.conf. You could modify and use this, but it's better to leave it alone because it's a useful testing tool.

Let's be like real nerds and make our new site from scratch. First create its document root (which in this example is test.com), enter the new directory, then create and test your sample index page: $ sudo mkdir -p /var/www/test.com $ cd /var/www/test.com $ sudo nano index.html Feel free to copy this for your new test page. Minder X20cls Manually. It must be named index.html and go in your document root: Test.com index page Hello, welcome to test.com! That is all I have to say. If you don't see this then it doesn't work. Test your new index page by opening it in a web browser (Figure 2), which in this example is file:///var/www/test.com/index.html. Hurrah, it works!

At this point you can go super-nerd and set up DNS for your test domain. Or you could do it the easy way with entries in your /etc/hosts file: 127.0.1.2 test.com 127.0.1.3 www.test.com These are localhost addresses, so your sites are not accessible outside of your PC. For more LAN testing you could use the /etc/hosts file on multiple computers in the same subnet, and enter the LAN IP address of your Apache server instead of a localhost address. Another option is to use Dnsmasq; creating a LAN server is easy with Dnsmasq, so check out to learn how. If you want a publicly-accessible web server over the big bad Internets, then you have a whole lot more work to do with registering domain names, setting up proper DNS, and building a good firewall. Do please study this intensively, and be careful!