admin管理员组

文章数量:1122796

Closed. This question is off-topic. It is not currently accepting answers.

Questions that are too localized (such as syntax errors, code with restricted access, hacked sites, hosting or support issues) are not in scope. See how do I ask a good question?

Closed 8 months ago.

Improve this question

I have a wordpress website hosted on my homelab that I exposed to the internet a year ago and due to my registrar Freenom having legal issues I was not able to renew the domain, I haven't had time to focus on it due to being busy however now I am planning on taking the site live again.

My current problem is I am unable to access the website even though it's currently hosted locally as the domain has expired. I've tried mapping the domain using the hosts file however it just redirects me to the apache start page

Here is what my hosts file looks Like this is on a windows client

192.168.10.21 exampladomain

Here is the apache server config running on Ubunto Server 20.4

<VirtualHost *:80>
    ServerName exampledomain
    ServerAdmin admin@exampledomain
    DocumentRoot /var/www/html/exampledomain
    <Directory /var/www/html/exampledomain>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
    </Directory>
    LogLevel info ssl:warn
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

I've disabled the SSL config as the certificate is now invalid

is there an easy way to access the website using the domain without me having to setup a DNS server?

Closed. This question is off-topic. It is not currently accepting answers.

Questions that are too localized (such as syntax errors, code with restricted access, hacked sites, hosting or support issues) are not in scope. See how do I ask a good question?

Closed 8 months ago.

Improve this question

I have a wordpress website hosted on my homelab that I exposed to the internet a year ago and due to my registrar Freenom having legal issues I was not able to renew the domain, I haven't had time to focus on it due to being busy however now I am planning on taking the site live again.

My current problem is I am unable to access the website even though it's currently hosted locally as the domain has expired. I've tried mapping the domain using the hosts file however it just redirects me to the apache start page

Here is what my hosts file looks Like this is on a windows client

192.168.10.21 exampladomain.com

Here is the apache server config running on Ubunto Server 20.4

<VirtualHost *:80>
    ServerName exampledomain.com
    ServerAdmin admin@exampledomain
    DocumentRoot /var/www/html/exampledomain
    <Directory /var/www/html/exampledomain>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
    </Directory>
    LogLevel info ssl:warn
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

I've disabled the SSL config as the certificate is now invalid

is there an easy way to access the website using the domain without me having to setup a DNS server?

Share Improve this question asked May 16, 2024 at 6:33 AleytiaAleytia 113 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 1

I seem to have fixed the problem by disabling secure DNS on Chrome

Settings >>> Privacy and Security >>> Security >>> Use Secure DNS

This is apparently not allowing the edits done on the hosts file which means chrome does not know how to resolve the domain

Find the IP Address of the Website use command nslookup yourdomain.com replace yourdomain.com from your expired domain

Edit the hosts File

Open Notepad as an administrator (Right-click Notepad and select Run as administrator). Open the hosts file located at C:\Windows\System32\drivers\etc\hosts.

Add an Entry to the Hosts File:

Add a new line at the end of the file with the IP address and the domain name.

Save the Hosts File:

Save the file and exit the text editor. You might need to clear your DNS cache for the changes to take effect. Windows: Open Command Prompt and run ipconfig /flushdns.

By using this above steps you can access website using hosts of expired domain.

本文标签: multisiteAccess website using hosts due to expired domain