I'm developing a site in local, and I would like to allow access to it to my friend through the web.
So I opened ports in my router and Firewall, but now I'm stuck configuring Apache.
Looked for it and it seems it's around those lines but I can't get it to work, when trying to connect, I get the forbidden message, so it seems port configuration is ok and it's really on server configuration...
<Directory />
AllowOverride none
Require all denied
</Directory>
And further
<Directory "${INSTALL_DIR}/cgi-bin">
AllowOverride None
Options None
Require all granted
</Directory>
First of all, am I right?
And if so, I just don't what to allow or write...
note : WAMP version 3.0
fullversion is : 3.0.6 for a 64 bits platform.
I'vre tried combination if ruleset, bu t I can't get my hand on it
Just open your website link in your browser and get your IP-Address from your network you are currently connected. Give the IP to your friend and the port number. He will become able to access it.
For example, your wifi/ethernet IP is 192.168.10.8 and port is 3000, so your friend give such 192.168.10.8:3000 in his browser and he will access it. Thanks
Related
I've created a blog, it's a homework of my web application class. The teacher asked us to host it. I'm the only one who have decided to host the server at my own PC, which is always switched on.
I'm running this server in Windows 10. I'm using XAMMP.
I've created a domain name at no-ip.com. After hours of fighting against the configurations, I've got the website working in my computer, in my LAN and finally, the whole Internet too.
I know the worst have been over. So it's just a silly thing I want to fix. I have my website inside this directory: C:\xampp\htdocs\wordpress
If I want to access to it, I must write http://IP/DNS.ddns.net/wordpress
I want to get rid of the "/wordpress"
I would like to access to my website with the specific ddns I have created without having to type /wordpress at the end.
I'm sure this have a name but I can't guess it right now, and I don't know how to configure this for Windows 10. I'm still learning it in another subject, but it's for Linux and Windows Server (IIS). The most alike is Linux (Apache) but the files and directories are different.
Can you help me, please? Thanks in advance!
You should set DocumentRoot variable]1 in apache to the proper path.
For example if you have
DocumentRoot "c:/www"
<Directory "c:/www">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
You should edit it to be
DocumentRoot "c:/www/wordpress"
<Directory "c:/www/wordpress">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
And restart apache
I can access my localhost using a computer, and I can access it too via my mobile phone, but when I installed wordpress on it, I can no longer access it via mobile phone, it's always telling me "localhost refused to connect" with error code ERR_CONNECTION_REFUSED but it works completely fine on my computer. I tried removing the .htaccess but no luck. However, I can access html files for example the readme.html (on phone http://192.168.0.13/readme.html)
My current IPv4 Address on my computer is 192.168.0.13, and I use this address to access it on my phone, but it always redirects me to "localhost". Is it because the home url of my wordpress is set to "http://localhost"? How can I fix this?
This is my httpd-vhosts.conf (if it helps)
# Virtual Hosts
#
<VirtualHost *:8080>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
Require ip 192.168.0.1
Require ip 192.168.0.28
Require ip 192.168.0.33
Require ip 192.168.0.13
</Directory>
</VirtualHost>
I am using WampServer Version 3.1.0 64bit and here are my configurations
Apache 2.4.27
PHP 7.1.9
MySQL 5.7.19
MariaDB 10.2.8
What am I missing? I badly need it to work, it's for my web development purposes.
Is it because the home url of my wordpress is set to "http://localhost"?
Yes, it probably is. If you are being redirected to localhost constantly. You can access a HTML file because it does not containt the logic of the Wordpress PHP installation which will try to redirect you to the base URL. Try changing the base URL of your wordpress installation in the admin panel on your computer (if that is possible) otherwise you should change the base url in the wp-config.php file.
Try changing it to your local IPv4 address: http://192.168.0.13
This can probably help you: https://codex.wordpress.org/Changing_The_Site_URL
Also for your apache configuration try this:
ServerName 192.168.0.13
ServerAlias localhost
I do not have any real experience with Apache but as far as i understood the documentation this should work for you.
Sources:
https://httpd.apache.org/docs/2.4/vhosts/name-based.html
https://httpd.apache.org/docs/2.4/mod/core.html#servername
https://httpd.apache.org/docs/2.4/mod/core.html#serveralias
Jeez, I tried changing both wordpress address and site address to my local ipv4 address 192.168.0.13, and voila, I can finally accessed it. Lol
I'm so dumb, Thank you for the help guys.
I have Wamp Server installed on a Windows Server 2008. It's working fine on local, and here is my phpmyadmin.conf :
<Directory "c:/wamp/apps/phpmyadmin4.0.4/">
Options Indexes FollowSymLinks ExecCGI
AllowOverride all
Order Allow,Deny
Allow from all
Allow from ::1
</Directory>
The problem, is that I can access to phpmyadmin from my computer with servername/phpmyadmin, but I can't access to my websites nor the index page with servername/ or servername/site.
The port is 80.
I have this error :
Forbidden
You don't have permission to access /glpi on this server.
If you wish to allow access to your site in \wamp\www\glpi then the best solution is to create a Virtual Host but if you just want a quick solution all you need to do is use the wampmanager menu as follows :-
wampmanager -> Put Online
This will make the correct change, which is to change the httpd.conf file.
Here is a link to another answer on how and why to create Virtual Hosts, it is aimed at WAMPServer 2.5 but it will work just as well for WAMPServer 2.4 Project Links do not work on Wamp Server
For those who this was not obvious, the error came from the first line :
<Directory "c:/wamp/apps/phpmyadmin4.0.4/">
This only give access to the phpmyadmin directory. So the solution is to replace or add a new block with :
<Directory "c:/wamp/www/">
And now you'll gain the access to your websites from another computer.
How can i access my local wamp server on another computer
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
</Directory>
i use this code in http.config file but not work
You could simply use the Put Online option of your WAMP Server and you can use this current system IP address and to directly access from the other computer.
Do this on system tray
Then, you could find your IP address using typing ipconfig or whatismyip.com website and then access it on another system.
As you are able to access it from the local computer that run the server by http://localhost you have two options to access it from your local area network LAN:
Using the local IP of the computer for example: http://192.168.1.20
Using the computer name for example: http://computer1/
To know your current IP:
Start -> in search field write cmd and hit enter to open the command line -> in the command line write: ipconfig you will get something like that:
Your computer IP address is the value of IPv4 Address.
To know your computer name just right click on the computer icon in the start menu then choose properties to get this screen shot:
However, for computer name method you have to be sure that every computer in your LAN has a unique name.
Update
There are some routers firmware supports local DNS on the router, so you have not need to edit the hosts files for every machine in the network. For example that I already have, dd-wrt firmware on Linksys WRT54G:
Mine wasn't working before when I tried using my computer's IP in the URL.
I found the reason to be the line in httpd.conf:
ServerName localhost:80
which I updated to be
ServerName {My comp's IP}:80
Step 1 : Press window button + R at the same time which opens the run tool of Windows.
Step 2 : Write CMD, then press 'Enter' button. This operation opens CMD terminal.
Step 3 : Then write 'ipconfig' command
Step 4 : Then note your ipv4 Address : 192.168.x.x (From Wireless Lan Adapter Wi-Fi Header) (This Ip address is needed by other computers in the place of localhost in URL)
Step 5 : Go to phpmyadmin.conf file of hosting system(Where wamp is installed...File path -> C:\wamp\alias\phpmyadmin.conf)
Step 6 : Replace this statement
<ifDefine APACHE24>
Require local
</ifDefine>
<ifDefine !APACHE24>
Order Deny,Allow
Deny from all
Allow from localhost ::1 127.0.0.1
</ifDefine>
with
Require local
Require ip 192.168.0
Note : (If your Ip is something like 192.147.x.x) then you write 'Require 192.147.0' instead of 'require 192.168.0')
Step 7 : Restart your Wamp server
Step 8 : Enter the link 192.x.x.x/phpmyadmin in the url bar of your own system from which you want to access the hosting wamp server
Step 9 : End.
If you just need to access the wamp server from another LAN PC, as some of the answers have pointed out, you can use the LAN IP or Computer-Name in the URL, as long as VirtualHost's ServerName or ServerAlias directive contains that LAN IP or Computer-Name (so Apache can return the correct website).
But if you need to use a domain-name, you'll have to edit every PC's Hosts file and update it with the correct domain-name to LAN IP address resolve (and make sure that LAN IP is assigned each time to the correct device by the Router).
Though there are much better solutions that will work for all devices (including Mac, Linux, mobile devices such as iPhones, Android phones, etc) if you have a WiFi Router that can either be flashed with one of the open firmwares or is already capable of DNS Masquerading as outlined here: Accessing Websites on a Local Network (LAN) Web Server. "DNS Masquerading" (in this context) is basically using the WiFi Router's own "Hosts file" to do the domain-name to LAN IP resolve.
Hope this helps
I couldn't connect event after doing all the above-mentioned steps. Then I uninstalled my current wampserver (3.0 version) and installed 2.5 version of wampserver. And it worked perfectly. You just need to click on 'Put Online' and you are done. Others can access your server by putting your ip address in the URL instead of localhost.
stop the wamp server and open C:\wamp64\bin\apache\apache2.4.41\conf\extra\httpd-vhosts.conf
replace
# Virtual Hosts
#
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
add
Require all granted
above the Directory closing tag.
Then turn off the windows firewall for [domain, private,
public] networks in my case only [private network] works
Re-Start wamp server
I'm trying to open a connection between my android emulator and server (currently testing on local.)
I'm following this tutorial
The problem arises when trying to read the php file itself.
I have internet permissions setup in the manifest file, so thats ok; what get's recorded into the JSON array however is infact a "403 Forbidden" html message, mentioning that I'm not allowed access to the file getAllPeopleBornAfter.php
If anyones encountered a solution to this problem I'd greatly appreciate some help with it. Otherwise, I was hoping someone could tell me how I could allow public use of php scripts without allowing the file for download / be seen?
Thanks in advance
Check the Server Configuration.
Set Listen to :
Listen *:80
(Where 80 is the port you are listening at. Or any other port for that matter.)
And in the Alias Section of the configuration file:
Comment The 'Deny From All' Using '#'. In case you don't want everyone to access but only from particular addresses then insert the Ip Addresses using Allow as shown.
<Directory "i:/myproject">
Options FollowSymLinks Indexes
AllowOverride All
Order deny,allow
Allow from 127.0.0.1
Allow from 192.168.1.15
#Deny from all
Require all granted
</Directory>