4-Laboratoriya topshirig’i Mavzu: iscsi ni o’rnatish va sozlash. Lamp server. Ishdan maqsad
Download 0.63 Mb.
|
mydomain.com with your own.
sudo nano /etc/apache2/sites-available/mydomain.com.conf ServerAdmin webmaster@mydomain.com ServerName mydomain.com ServerAlias www.mydomain.com DocumentRoot /var/www/mydomain.com/public_html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined Save and exit (press CTRL + X, press Y and then press ENTER) Test for errors. apachectl configtest You can ignore any error that mentions “Could not reliably determine the server’s fully qualified domain name”. Enable your virtual host replacing mydomain.com with your own. sudo a2ensite mydomain.com.conf Disable the default Apache website, otherwise it will override your virtual host. sudo a2dissite 000-default Restart Apache. sudo systemctl reload apache2 8.3. Test Virtual Host If you don’t have a registered domain name, you can skip to Step 8.4 below to trick your OS into resolving a domain name of your choice to your Ubuntu 20.04 / 20.10 LAMP server. You will now need to go to your domain registrar’s DNS settings and point the A record for your domain to the IP of your Ubuntu 20.04 / 20.10 LAMP server. Once the A record has propagated (may take 24-48 hours), you should be able to see your test page in the browser. To add more domains, simply repeat Step 8 above. 8.4. Edit Hosts File (optional) If you do not have any domains registered and instead just want to load mydomain.com in your browser as a test, you can edit the hosts file in your OS to point these domains to your Ubuntu 20.04 / 20.10 LAMP server. To edit the hosts file in Linux or Mac, run sudo nano /etc/hosts in terminal. In Windows, follow this guide to edit hosts. Once the hosts files is open, enter your Ubuntu 20.04 / 20.10 LAMP server’s IP followed by the domain name you want to resolve. hosts x.x.x.x mytest1.com Replace x.x.x.x with your web server’s IP. If you don’t know your web server’s IP, you can find out with: ip addr show eth0 | grep inet | awk '{ print $2; }' | sed 's/\/.*$//' Once you’ve saved your hosts file, you should be able to access Download 0.63 Mb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling