Virtual Host in WSL2 not accessible from windows browser - apache2

I had setup a virtual host for the osm tile server. All the tables are made and style sheet is generated using mapnik using this tutorial:https://www.linuxbabe.com/ubuntu/openstreetmap-tile-server-ubuntu-20-04-osm
The only process I changed here is using service instead of systemctl as the latter is not supported. I have named the vhost as tile.gearmap.com in the config files. These are the files: -
/etc/apache2/sites-available/tileserver_site.conf
<VirtualHost *:80>
ServerName tile.gearmap.com
LogLevel info
Include /etc/apache2/conf-available/renderd.conf
</VirtualHost>
/etc/renderd.conf
[renderd]
stats_file=/run/renderd/renderd.stats
socketname=/run/renderd/renderd.sock
num_threads=10
tile_dir=/var/cache/renderd/tiles
[mapnik]
plugins_dir=/usr/lib/mapnik/3.1/input
font_dir=/usr/share/fonts/truetype
font_dir_recurse=true
; ADD YOUR LAYERS:
[default]
URI=/osm/
XML=/home/osm/openstreetmap-carto/style.xml
HOST=tile.gearmap.com
https://www.linuxbabe.com/ubuntu/openstreetmap-tile-server-ubuntu-20-04-osm
[Service]
User=osm
Result of Apache2 server status
I also added the third line to hosts hoping it would work:
However, when I open http://tile.gearmap.com/osm/0/0/0.png in my chrome, it shows 404 error instead of the map tile. This is all done in wsl ubuntu 20.04 and browser is in windows. Please help me find the error. If any additional files are needed to debug this, let me know.

Check if the traffic is exposed over tcp4 or tcp6 (try netstat within Ubuntu), there is a longstanding issue of WSL2 not supporting ipv6: https://github.com/microsoft/WSL/issues/4518

Related

Ubuntu 18.04 Apache2.4.29 not able to open ports other than 80

As stated in title, I have LAMP configuration with Apache2.4.29, the problem is when I open a new port other than 80(in this case, port 12743), it could not be accessed through edge browser as port 80 does.
I added a line here under /etc/apache2/ports.conf:
appended a paragraph under /etc/apache2/sites-enabled/000-default.conf
after that I used the following command to restart Apache2:
all these shows no warning nor error messages.
The Ubuntu currently has ufw inactive, and used iptables and fail2ban instead:
however, attempts to access the website via new port failed returning the following page:
I wonder what might be the problem.
Problem solved, what I needed was just a sudo reboot.
It turned out that adding ports shall require not only an Apache2 restart but also a server reboot.

Moodle unable to access using domainName

Installing MOODLE_33_STABLE origin/MOODLE_33_STABLE on Ubuntu 16.04.2
I am able to install it and , access it with my vm's ip,
but when i try to change
$CFG->wwwroot = 'http://ipaddress'
to
$CFG->wwwroot = 'http://somerandomname.com'
in config.php,
i am unable to access it using somerandomname.com in my lan.
i have also mapped the vm ip in hosts file of both apache2 and of the other systems in lan, still it shows HTTP ERROR 502, in chrome.
and Host not found when i check the chrome console.
if i am missing something guide me.
i want to access the moodle installed on my VM across my local connection with some domainname rather than the IP .
Thank you.
Sounds like you have to try classical debugging:
Try to access your moodle instance on the specific port, using eg. telnet
telnet somerandomname.com 80
Delete browser cache or open the URL in your incognito mode
Check the apache error log on Ubuntu: /var/log/apache2/error.log.
Check out further possibilities which are causing this 502 error:
https://www.lifewire.com/502-bad-gateway-error-explained-2622939

Jenkins Artifactory plug-in: Error occurred while requesting version information: Connection refused

I get the error "Error occurred while requesting version information: Connection refused" when I test the connection in Jenkins configuration for Artifactory plug-in. I have tried it with Anonymous access enabled in Artifactory, with Anonymous access disabled, and tried all three options (Supported, Unsupported, Required) for Password Encryption in Artifactory. I have Default Deployer Credentials in my Jenkins Artifactory configuration, and I have tested the connection with 'Use Different Resolver Credentials' and without. I consistently get this error.
Any help/ideas would be greatly appreciated
I also ran in a similar problem yesterday.
Problem:
I was running jenkins and artifactory in two different docker containers on my local. I had exposed port 8086 for artifactory and could access it using http://localhost:8086/artifactory in my browser. But giving the same url for artifactory in jenkins produced the above reported error in question.
Solution:
For some unknown reasons, jenkins artifactory plugin couldn't resolve http://localhost:8086/artifactory even though the docker mappings was correct and it was possible to connect to artifactory web based console with the same URL.
Replacing "localhost" with docker container IP did the trick.
Name of my container in which artifactory was running was docker-plgr_artifactory_1
Admins-MacBook-Pro-2:~ prakash.tiwari$ docker exec -it docker-plgr_artifactory_1 cat /etc/hosts
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
172.18.0.2 08038bc9449b
The IP of container was 172.18.0.2. So I replaced http://localhost:8086/artifactory with http://172.18.0.2:8081/artifactory and jenkins was now able to connect to artifactory. (8081 is the port in docker container at which artifactory was running. You'd have given it at the time of running the container. Alternatively, you can find it by running docker ps and checking the value under PORTS field.)
Credit: https://www.arvinep.com/2016/04/jenkins-docker-container-problem.html
Note: I know this solution doesn't explain the cause and why it works, but I hope it at least helps some people and saves their time.
I see that you asked this question a while ago. I just had to deal with a very similar situation. I had loaded the root and intermediate certificates into the cacerts files found under the 4 version of Java on the build server. The problem was that Jenkins uses it's own cacerts file found in the Jenkins install folder. Once I loaded the certs there I was able to test the connection to artifactory and upload the build artifacts. I hope this helps

Localhost very slow on Windows 7 (tried other suggestions..nothing worked)

I know this has been asked before but I have tried every suggestion i've found but nothing seems to work
My localhost seems to take forever to load pages (up to 30 secs). Ihave the follwoing installed on Windows 7
I am running:
Apache 2.4
PHP 5.4.9
MySQL 5.5.25
Things I have tried:
Edited the hosts file in Windows\System32\drivers\etc
# localhost name resolution is handled within DNS itself.
127.0.0.1 localhost
Edit the http.conf file to give a ServerName
# If your host doesn't have a registered DNS name, enter its IP address here.
#
ServerName 127.0.0.1:80
Has anyone got any other suggestions?

Remote debugging with XDebug and PHPStorm

First things first:
Server is an Apache running on Debian in a VMPlayer
Host is Windows 7
Debugging-Server is XDebug
Files are directly accessible via a shared folder
Important: XDebug is properly configured on Apache and my Win7 firewall as well. I know that b/c I can debug using Eclipse.
So what I am failing at seems to be the basic configuration of PHPStorm.
Let me give you some more details:
IP of Server: 192.168.56.128
IP of my host: 192.168.56.1
the file that I want to debug is index.php:
location on my Win7 host: C:\dev\sf\Symfony\
location on Debian: \mnt\hgfs\sf\Symfony\
URL: 192.168.56.128/Symfony/index.php
No matter what I fiddle together ... I get weired error messages like "Waiting for connection from JetBrains PhpStorm..." or PHPStorm asks me for Mozillas profile.ini, even though I configured Chrome as Default in Web Browsers.
So I will just set up a new project and hopefully someone tells me what is wrong with my configuration.
Run / Edit configurations / Defaults / PHP Remote Debugging:
Server: "Debian"
IDE key: -
Break at first line: yes
Servers:
Name: "Debian"
Host: 192.168.56.128
Port: 80
Debugger: Xdebug
use path mappings: yes
one path mapping configured:
C:\dev\sf\Symfony => /mnt/hgfs/sf/Symfony (also tried /Symfony - b/c PHPStorm shouldn't care about anything above /Symfony !?)
Run / Edit configurations / Defaults / PHP Web Application:
Server: "Debian"
Start URL: /Symfony
Browser: Chrome
Break on first line: yes
Now I choose: Run / Debug ... / 1.index.php
And I get asked for: Mozilla's profile.ini ... but I can't find it
Where is it ... ?
I already got so far that PHPStorm started Chrome. But maybe I first sort this out. So how can I get Firefox up and running? I also use Firefox with Eclipse ... no questions asked for a profile.ini.
Okay, there are three things I'd like to share with you. It's not the full recipe but the key ingredients that were first confusing me are:
The important sections to configure are "Servers" and "PHP Remote Debugging".
To configure "PHP Remote Debugging" you have to first add a new dataset using the [+] in the top left corner. The panel you get from just clicking on the "PHP R D"-button just keeps the default settings!
Absolute path regarding the VM actually means the absolute path starting from root (\mnt\hgfs\sf\Symfony). This was confusing to me cause I am still not sure why PhpStorm cares about directory levels above the shared folder. but it does.
If you are still having problems, there are two blog posts by the makers on how to set things up correctly.
First should work in most cases and requires zero-configuration other than a working xdebug install
Second details all of the configuration settings in detail
To 'see' the profile.ini in the PHP Storm 'Select File' Dialog simply rightclick inside of it and choose 'Show hidden files' then (in WIn7) move to C:\Users\YOURUSERNAME\AppData\Roaming\Mozilla\Firefox or the equivalent in your OS
Ensure that remote debugging is enabled in php.ini
xdebug.remote_enable = 1
Your server "192.168.56.128" should be in PHP-> Servers
Add PHP Web Application Debug Configuration, and use added server
Set a breakpoint and start debugging using this configuration

Resources