Moving the forum to vps on debian 11.

Started by dodos26, January 22, 2023, 07:51:23 AM

Previous topic - Next topic

dodos26

Hi, I'm moving the forum to vps because of being cheated by my service provider who silently changed the opcache restriction and pretends that he didn't do anything like that. ( ovhcloud )

I will note that I did it my way because practically every guide I encountered did not work in some part.

#1 I'm starting with install apache2:
sudo apt update
sudo apt install apache2
Test - WORK OK.

#2 Next install mysql-server:
sudo apt update
sudo apt upgrade
sudo apt install wget
sudo apt install gnupg
Get version from:
https://dev.mysql.com/downloads/repo/apt/
wget https://dev.mysql.com/get/mysql-apt-config_<VERSION>.deb
sudo dpkg -i mysql-apt-config_<VERSION>.deb
sudo apt-get update
sudo apt-get install mysql-server
systemctl status mysql
If you haven't set root password:
sudo mysql_secure_installation#3 Install php:
sudo apt-get install php libapache2-mod-php php-cli php-mysql php-zip php-curl php-xml -y#4 Install phpmyadmin:
sudo apt-get install phpmyadmin
sudo cp /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
sudo a2enconf phpmyadmin
sudo service apache2 restart

#5 Install or configure mail:
HOW DO IT? I need something simple safe efficient. Only and only for sending messages via SMF to work.

#6 Install certbot for letsencrypt ssl:
sudo snap install core; sudo snap refresh core
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
sudo certbot --apache
sudo certbot certonly --apache

It's not working for me maybe because I don't have domain set in apache? Only the default html directory.

#7 Setting dns zone:
How set me domain to tryhackx.org for example 200.200.200.200
How configure mail for it also read #5.
How add subdomain tracker.tryhackx.org

Now admin pls remove it if is danger:
$TTL 3600
@ IN SOA dns14.ovh.net. tech.ovh.net. (2023012103 86400 3600 3600000 300)
                          IN NS     dns14.ovh.net.
                          IN NS     ns14.ovh.net.
                          IN MX     1 mx1.mail.ovh.net.
                          IN MX     100 mx3.mail.ovh.net.
                          IN MX     5 mx2.mail.ovh.net.
                          IN A      213.32.10.111
                          IN AAAA   2001:41d0:301:5::28
                          IN TXT    "1|www.tryhackx.org"
                      600 IN TXT    "v=spf1 include:mx.ovh.com ~all"
_autodiscover._tcp        IN SRV    0 0 443 mailconfig.ovh.net.
_imaps._tcp               IN SRV    0 0 993 ssl0.ovh.net.
_submission._tcp          IN SRV    0 0 465 ssl0.ovh.net.
autoconfig                IN CNAME  mailconfig.ovh.net.
autodiscover              IN CNAME  mailconfig.ovh.net.
ftp                       IN CNAME  tryhackx.org.
imap                      IN CNAME  ssl0.ovh.net.
mail                      IN CNAME  ssl0.ovh.net.
pop3                      IN CNAME  ssl0.ovh.net.
smtp                      IN CNAME  ssl0.ovh.net.
tracker                   IN A      213.32.10.111
tracker                   IN AAAA   2001:41d0:301:5::28
upload                    IN A      213.32.10.111
upload                    IN AAAA   2001:41d0:301:5::28
www                       IN MX     1 mx1.mail.ovh.net.
www                       IN MX     100 mx3.mail.ovh.net.
www                       IN MX     5 mx2.mail.ovh.net.
www                       IN A      213.32.10.111
www                       IN AAAA   2001:41d0:301:5::28
www                       IN TXT    "3|welcome"
www                       IN TXT    "l|pl"
www.tracker               IN A      213.32.10.111
www.upload                IN A      213.32.10.111
www.upload                IN AAAA   2001:41d0:301:5::28

vbgamer45

For #5 https://netcorecloud.com/tutorials/install-postfix-as-send-only-smtp-server/
You will need to make changes to your zone file for the spf record, mx and everything else since right now pointed to ovh

#7
To change the main IP you want to find the IN A record and update that
For tracker subdomain update AAAA is the IPV6 address if you have if not remove.
tracker                   IN A      213.32.10.111
tracker                   IN AAAA   2001:41d0:301:5::28

You must restart bind anytime you make a change. Test with intodns.com for your domain to make sure a record still points right


I would check what Apache version you using sometimes the default gives you an older apache version that misses some features latest apache is 2.4.55
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

dodos26

Wow bro! Sending mail work now! Thanks u so much!

I wonder, however, whether the person sending the e-mail in the case of e.g. password recovery or account confirmation always writes as "Me" idk how in englich it work but in pl is "I"?

And You cannot view this attachment. When I receive an email from some companies, I often see the name [email protected] here. I guess the hostname is the part before @, but how change after @?

Since I don't need a return message by mail, I don't need DNS for MX?

what is that?
$TTL 3600
@ IN SOA dns14.ovh.net. tech.ovh.net. (2023012103 86400 3600 3600000 300)

                          IN TXT    "1|www.tryhackx.org"
                      600 IN TXT    "v=spf1 include:mx.ovh.com ~all"
_autodiscover._tcp        IN SRV    0 0 443 mailconfig.ovh.net.
_imaps._tcp               IN SRV    0 0 993 ssl0.ovh.net.
_submission._tcp          IN SRV    0 0 465 ssl0.ovh.net.
autoconfig                IN CNAME  mailconfig.ovh.net.
autodiscover              IN CNAME  mailconfig.ovh.net.

vbgamer45

Check your servers  hostname also put in a request with your hosting provide to change the rDNS entry for your ip to match your domain
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

dodos26

In DNS  haven't changed anything, just want to know what it is and what it's for. And how to change the display of this name in mail.

vbgamer45

Thats either the hostname of the server or rdns of the ip of the server
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

dodos26

#6
Hmm i setup it:
You cannot view this attachment.

Apache sites available config:
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName tryhackx.org
ServerAlias www.tryhackx.org
DocumentRoot /var/www/tryhackx.org

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

<VirtualHost *:80>
ServerAdmin [email protected]
ServerName tracker.tryhackx.org
ServerAlias www.tracker.tryhackx.org
DocumentRoot /var/www/tracker.tryhackx.org

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

And Domain DNS settings:
$TTL 3600
@ IN SOA dns14.ovh.net. tech.ovh.net. (2023012300 86400 3600 3600000 300)
           IN NS     ns14.ovh.net.
           IN NS     dns14.ovh.net.
           IN A      135.125.202.143
           IN TXT    "1|www.tryhackx.org"
www        IN A      135.125.202.143
www        IN TXT    "3|welcome"
www        IN TXT    "l|pl"


I don't know if it's time to propagate domain but I get now 404
https://intodns.com/tryhackx.org here see
WWW A Record   Your www.tryhackx.org A record is:
www.tryhackx.org  [135.125.202.143]

What is bad?
When the configuration was standard after installation and forum be in var/www/html it work when i entered the ip.


Yeah it work very slow but work idk why when using ip work faster...

vbgamer45

Looks like something is wrong with the apache config I can't get to the site at all via domain. doesn't look
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

dodos26

Ok bro all work ssl also work but idk how set mail domain.
You cannot view this attachment.
I try set myhostname but not work

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_un>
myhostname = vps-xxxxx.vps.ovh.net
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = $myhostname, localhost.$your_domain, $your_domain
relayhost =
...
inet_interfaces = loopback-only

dodos26

Ok bro I use it:
https://serverfault.com/questions/490825/how-to-set-the-domain-name-on-gnu-linux

And work now but gmail says that the message may be a scam and that it doesn't have a signature or something. I reported it as safe and now I have no way to show it.

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro


vbgamer45

Yup, next step fix the issues listed.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

dodos26

Yaay It work now good :)) Thanks u, for send this web. But I can do one more thing:
(but dont know how)
Reverse DNS or rDNS checks whether a domain is associated with a given IP address.
Some companies, such as AOL, reject messages from servers that do not have rDNS.
You can only associate one domain with one IP address.
Your IP address 135.125.202.143 is associated with the domain vps-dd0a0715.vps.ovh.net.
However, your message appears to have been sent from tryhackx.org.

Consider changing your PTR record to tryhackx.org or use vps-dd0a0715.vps.ovh.net as the hostname in your email client.

Result for this test:
IP: 135.125.202.143
HELO: tryhackx.org
rDNS: vps-dd0a0715.vps.ovh.net

vbgamer45

Your host changes that/server company.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

dodos26

So I can't do it myself in host files or something like that, I have to write to this support which doesn't help anyway.
You cannot view this attachment.

vbgamer45

You can't change rDNS yourself unless it is delegated which is highly unlikely or if they have a control panel to set it
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Advertisement: