|
Network Guide |
How to setup and use a Web Server
Setting up IIS Web Server in Windows
- Login to server or PC
- For servers:
- Load Server Manager, Add Roles and Features.
- select Roles, Web Server (IIS).
- Add required features.
- Add or enable any required features for web server.
- Click Install.
- For workstations:
- Open Control Panel, Programs and Features and select 'Turn Window features on or off'.
- Select Internet Information Services, Web Management Tools and World Wide Web Services.
- Click Ok to install.
- To configure the web server, use the Internet Information Services (IIS) Manager console.
- Use Basic Settings to configure location of web pages.
- Default document location is c:\Inetpub\wwwroot.
- Use Bindings to change the IP address, Port, Host name and protocol (HTTP or HTTPS).
- Use the IIS settings to in main IIS window to change other site specific settings.
- Additonal plugins can be installed via the Web Platform Installer e.g. .NET, PHP, Python, drivers, IIS features.
- Once configured, you can access the web site on http://localhost. If you want to access it by name, then add the web site
name onto DNS, or add it to your hosts file in c:\Windows\System32\Drivers\Etc.
Installing Web Server for Unix or Linux
- Login to the server with user with administrator privileges (e.g. sudo).
- Install the package using whatever method suitable.
- A package manager.
- Enter apt-get update; apt-get install apache2 (or nginx)
- Enter yum install apache2
- Configure the web server.
- For apache2, see /etc/apache2.
- Create webserver.conf in sites-available/sites-enabled
(use copy of 000-default.conf as a template for new sites).
- For nginx, see /etc/nginx.
- Create webserver.conf in sites-available/sites-enabled
(use a copy of default as a template for new sites).
- Create or copy web pages to Document root location e.g. /var/www/html.
- Restart the web server service.
- Run systemctl restart apache2 or apachectl restart
- Run service apache2 restart
- Run systemctl restart nginx
- Run service nginx restart.
- Visit website via http://localhost.