Back to main index

Setup www

Setup the domain.
This guide assumes that DNS records have been setup correctly (A record for ipv4, AAA record for ipv6)

I used this guide to setup an Apache virtual host.

sshocean                          # login to DigitalOcean as root
yum install httpd httpd-tools     # user & group "apache" get created now

Transfer the website to host

su mihai
cd $HOME/
mkdir Code
git clone git-main
exit               # back to root

cd /home/mihai/Code/git-main/script/
./httpd.update     # transfer the content

Now continue with the server setup.

ls -laZ /var/www/html
drwxr-xr-x. 3 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 4096 Nov  1 20:03

cd /etc/httpd
mkdir -v sites-enabled sites-available

Edit the server configuration.

cd conf
emacs httpd.conf

# change as follows:
DocumentRoot         "/var/www/html"
<Directory           "/var/www/html">
    AllowOverride    None
    Require          all granted

# add at the end of file
IncludeOptional      sites-enabled/*.conf


cd /etc/httpd/sites-available
touch           # end edit

# change as follows:
<VirtualHost    *:80>
    DocumentRoot     /var/www/html/
    ErrorLog         /var/log/
    CustomLog        /var/log/ combined

Finish the configuration and do the first test.

ln -s /etc/httpd/sites-available/ /etc/httpd/sites-enabled/
systemctl enable httpd.service
systemctl start  httpd.service

Back to main index