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 https://github.com/grayasm/git-main.git git-main
exit               # back to root

cd /home/mihai/Code/git-main/script/vasilian.net
./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 vasilian.net

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
</Directory>

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

Edit vasilian.net.conf

cd /etc/httpd/sites-available
touch vasilian.net.conf           # end edit

# change as follows:
<VirtualHost    *:80>
    ServerName       www.vasilian.net
    ServerAlias      vasilian.net
    DocumentRoot     /var/www/html/vasilian.net
    ErrorLog         /var/log/vasilian.net-error.log
    CustomLog        /var/log/vasilian.net-requests.log combined
</VirtualHost>

Finish the configuration and do the first test.

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

Back to main index