Back to main index

Migrate to next CentOS

Check how to set the domain name servers.

After I bought this domain, I used this guide to setup an Apache virtual host.
This guide assumes that DNS records have been setup correctly (A record for ipv4, AAA record for ipv6)

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

mkdir /srv/http
chown -v root:root /srv/http      # if this is not on DigitalOcean check SELinux also

mkdir /srv/http/
chown -v apache:apache /srv/http/

Transfer the website content 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.

chown -Rv apache:apache /srv/http/
cd /etc/httpd
mkdir -v sites-enabled sites-available
cd conf

Edit the server configuration.

emacs httpd.conf

# change as follows:
DocumentRoot         "/srv/http"
<Directory           "/srv/http">
    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     /srv/http/
    ErrorLog         /srv/http/
    CustomLog        /srv/http/ 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