You are not logged in.

#1 2013-03-28 08:14:04

armb78
Member
Registered: 2012-12-26
Posts: 29

Can't have access to my apache installed computer remotely

Hi,
I've installed apache and it works well with localhost. But when I type in my IP address, it gives error. I changed apache's default port to 8081, but it still doesn't work. How can I have access to this computer remotely?

Last edited by armb78 (2013-03-28 08:21:40)

Offline

#2 2013-03-28 15:12:41

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: Can't have access to my apache installed computer remotely

how did you install apache? do you get any errors? what are they? are you trying the IP address from the same computer or a different computer? If different, are they both on the same network? if yes, is there a firewall around the computer which has apache? if yes, have you forwarded the ports correctly?


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#3 2013-03-28 16:00:48

armb78
Member
Registered: 2012-12-26
Posts: 29

Re: Can't have access to my apache installed computer remotely

I installed apache from Arch's "extra" repository. I don't get any errors from localhost, but when I try it with my IP (from my own computer, a phone connected to the same network and even another computer), I get error. Ping says "unknown host" and curl -I says "Connection refused". 8081 port work fine with localhost, but it doesn't work with my IP.

Offline

#4 2013-03-28 16:12:11

cookies
Member
Registered: 2013-01-17
Posts: 253

Re: Can't have access to my apache installed computer remotely

Check the configuration of your apache, you might have set it up so it only listens to connections from localhost.

Offline

#5 2013-03-28 16:21:40

armb78
Member
Registered: 2012-12-26
Posts: 29

Re: Can't have access to my apache installed computer remotely

I haven't changed anything in the configuration file, except port. I think these lines are about permission:

<Directory "/srv/http/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>

They're fine, yeah?

Offline

#6 2013-03-28 16:36:05

cookies
Member
Registered: 2013-01-17
Posts: 253

Re: Can't have access to my apache installed computer remotely

armb78 wrote:
<Directory "/srv/http/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>

They're fine, yeah?

Yes, they look fine, but I can't tell you, since I don't know any details about your setup. Luckily those lines are not the problem.

Check http://httpd.apache.org/docs/2.2/en/bind.html and http://httpd.apache.org/docs/2.2/en/vhosts/ and see if you can reach your server.

Offline

#7 2013-03-28 18:04:37

armb78
Member
Registered: 2012-12-26
Posts: 29

Re: Can't have access to my apache installed computer remotely

I tried to make a virtual host, but I still can't load it with my ip address

<VirtualHost 192.168.0.1:8081>
ServerAdmin webmaster@smallco.example.com
DocumentRoot /home/vapaapoika/www
ServerName Example
ErrorLog /home/vapaapoika/error_log
TransferLog /home/vapaapoika/access_log
</VirtualHost>

Offline

#8 2013-03-28 23:53:11

cookies
Member
Registered: 2013-01-17
Posts: 253

Re: Can't have access to my apache installed computer remotely

armb78 wrote:

I tried to make a virtual host, but I still can't load it with my ip address

<VirtualHost 192.168.0.1:8081>
    ServerAdmin webmaster@smallco.example.com
    DocumentRoot /home/vapaapoika/www
    ServerName Example
    ErrorLog /home/vapaapoika/error_log
    TransferLog /home/vapaapoika/access_log
</VirtualHost>

Is your IP 192.168.0.1 or did you just copy it from the example (you may change it to <VirtualHost *:8081> for now, so it matches any IP)? If it still doesn't work, please post your httpd.conf.

Oh, and please use code-tags, when posting snippets of code, logs or config files.

Offline

#9 2013-03-29 07:49:21

armb78
Member
Registered: 2012-12-26
Posts: 29

Re: Can't have access to my apache installed computer remotely

I don't know much about networking, but there's an IP that my ADSL identifies me with, and there's one for outside world. This is the one my ADSL wants. I tried both, but it doesn't work.
My httpd.conf file:

ServerRoot "/etc/httpd"
Listen 8081
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authn_dbm_module modules/mod_authn_dbm.so
LoadModule authn_anon_module modules/mod_authn_anon.so
LoadModule authn_dbd_module modules/mod_authn_dbd.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule authz_dbm_module modules/mod_authz_dbm.so
LoadModule authz_owner_module modules/mod_authz_owner.so
LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule file_cache_module modules/mod_file_cache.so
LoadModule cache_module modules/mod_cache.so
LoadModule disk_cache_module modules/mod_disk_cache.so
LoadModule mem_cache_module modules/mod_mem_cache.so
LoadModule dbd_module modules/mod_dbd.so
LoadModule dumpio_module modules/mod_dumpio.so
LoadModule reqtimeout_module modules/mod_reqtimeout.so
LoadModule ext_filter_module modules/mod_ext_filter.so
LoadModule include_module modules/mod_include.so
LoadModule filter_module modules/mod_filter.so
LoadModule substitute_module modules/mod_substitute.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule ldap_module modules/mod_ldap.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule log_forensic_module modules/mod_log_forensic.so
LoadModule logio_module modules/mod_logio.so
LoadModule env_module modules/mod_env.so
LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so
LoadModule ident_module modules/mod_ident.so
LoadModule usertrack_module modules/mod_usertrack.so
LoadModule unique_id_module modules/mod_unique_id.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule version_module modules/mod_version.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_scgi_module modules/mod_proxy_scgi.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule ssl_module modules/mod_ssl.so
LoadModule mime_module modules/mod_mime.so
LoadModule dav_module modules/mod_dav.so
LoadModule status_module modules/mod_status.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule asis_module modules/mod_asis.so
LoadModule info_module modules/mod_info.so
LoadModule suexec_module modules/mod_suexec.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule cgid_module modules/mod_cgid.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule dir_module modules/mod_dir.so
LoadModule imagemap_module modules/mod_imagemap.so
LoadModule actions_module modules/mod_actions.so
LoadModule speling_module modules/mod_speling.so
LoadModule userdir_module modules/mod_userdir.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
<IfModule !mpm_netware_module>
<IfModule !mpm_winnt_module>
User http
Group http
</IfModule>
</IfModule>
ServerAdmin you@example.com
DocumentRoot "/srv/http"
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>
<Directory "/srv/http">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>
<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy All
</FilesMatch>
ErrorLog "/var/log/httpd/error_log"
LogLevel warn
<IfModule log_config_module>
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common
    <IfModule logio_module>
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    </IfModule>
    CustomLog "/var/log/httpd/access_log" common
</IfModule>
<IfModule alias_module>
    ScriptAlias /cgi-bin/ "/srv/http/cgi-bin/"
</IfModule>
<IfModule cgid_module>
</IfModule>
<Directory "/srv/http/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>
DefaultType text/plain
<IfModule mime_module>
    TypesConfig conf/mime.types
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
</IfModule>
Include conf/extra/httpd-multilang-errordoc.conf
Include conf/extra/httpd-autoindex.conf
Include conf/extra/httpd-languages.conf
Include conf/extra/httpd-userdir.conf
Include conf/extra/httpd-default.conf
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
<VirtualHost 2.146.152.112:8081>
ServerAdmin webmaster@smallco.example.com
DocumentRoot /home/vapaapoika/www
ServerName Example
ErrorLog /home/vapaapoika/error_log
TransferLog /home/vapaapoika/access_log
</VirtualHost>

(I removed commented lines)

Offline

#10 2013-03-29 14:59:00

cookies
Member
Registered: 2013-01-17
Posts: 253

Re: Can't have access to my apache installed computer remotely

armb78 wrote:

I don't know much about networking, but there's an IP that my ADSL identifies me with, and there's one for outside world.

ip addr show

lists all your network interfaces and the corresponding ips (if any), take one of those if you want to listen for connections from a specific ip. The ip for the outside world is not going to work since your ADSL router won't know what to do with the request and will just ignore it.

My httpd.conf file:

Looks fine. There's one thing you could still try though. Change the VirtualHost part in the end to

<VirtualHost *:8081>
ServerAdmin webmaster@smallco.example.com
DocumentRoot /home/vapaapoika/www
ServerName Example
ErrorLog /home/vapaapoika/error_log
TransferLog /home/vapaapoika/access_log
</VirtualHost>

restart apache and try connecting again. (Instead of "*" you may enter the ip that "ip addr show" gives you.)

Do the log files show any error messages (check both /var/log/httpd/error_log and /home/vapaapoika/error_log)?

Offline

#11 2013-03-29 17:21:20

armb78
Member
Registered: 2012-12-26
Posts: 29

Re: Can't have access to my apache installed computer remotely

I tried virtual host. Again, it works with localhost, but not with my IP
I checked apache's root directory's permissions. They don't have any problem. I don't know what the problem is

Offline

#12 2013-03-29 17:44:47

cookies
Member
Registered: 2013-01-17
Posts: 253

Re: Can't have access to my apache installed computer remotely

Apache itself works (at least for localhost) and the config is fine. It looks like you have some trouble with your network setup.

Do you have apache installed in a virtual machine? If not I'm clueless myself.

Offline

#13 2013-03-29 18:11:50

armb78
Member
Registered: 2012-12-26
Posts: 29

Re: Can't have access to my apache installed computer remotely

No. It's not installed in virtual machine.I thought maybe it's about port 80. So I changed it to 8081. Can there be any other problem with my network setup?

Offline

#14 2013-03-29 18:24:01

cookies
Member
Registered: 2013-01-17
Posts: 253

Re: Can't have access to my apache installed computer remotely

Port 80 is the default port for http, you don't have to add it to the ip. But you may choose any port you like (unless its used by another service) and just add it to the ip.

I'm not a networking expert myself so I don't really know how to troubleshoot this. Take a lok at https://wiki.archlinux.org/index.php/Ne … figuration maybe that will help.

Offline

#15 2013-03-29 19:47:00

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: Can't have access to my apache installed computer remotely

Lets back up a few steps.  On the computer that is running Apache, please post the output of:

ip addr

I am skeptical that the address is 192.168.0.1.  That address is far more likely to be the address of your router, or other gateway.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#16 2013-03-29 19:52:06

armb78
Member
Registered: 2012-12-26
Posts: 29

Re: Can't have access to my apache installed computer remotely

 $ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
    link/ether 00:24:be:b7:62:57 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether 2c:81:58:f3:2d:e8 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.35/24 brd 192.168.1.255 scope global wlan0
    inet6 fe80::2e81:58ff:fef3:2de8/64 scope link 
       valid_lft forever preferred_lft forever

I think it means the IP address is 192.168.1.35, yeah? But, what should I do with it?

Offline

#17 2013-03-29 20:00:31

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: Can't have access to my apache installed computer remotely

Can you ping 192.168.1.35   ??
What about wget 192.168.1.35:8081   ??


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#18 2013-03-29 20:08:41

armb78
Member
Registered: 2012-12-26
Posts: 29

Re: Can't have access to my apache installed computer remotely

Yeah, I can ping it. wget works too

Offline

#19 2013-03-29 20:15:57

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: Can't have access to my apache installed computer remotely

Okay, so the web server is running.  You should be able to see and browse that address from anywhere on your private network.  Now, if you want to have that machine be accessible from the Internet, you must log into your router and set it to forward port 80 (or 8081, or whatever) to  192.168.1.35 port 8081.  You will also want to configure your router's DHCP server to always give the address 192.168.1.35 to your computer.  You will do that by the MAC address of your NIC (your router should show you that MAC, but it is 2c:81:58:f3:2d:e8 [just for the record])

Last edited by ewaller (2013-03-29 20:26:48)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#20 2013-03-29 20:16:39

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: Can't have access to my apache installed computer remotely

great. mark your thread as solved. Read up a bit more on Apache and networking in general. The wiki is a good place to start.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#21 2013-03-29 21:13:58

armb78
Member
Registered: 2012-12-26
Posts: 29

Re: Can't have access to my apache installed computer remotely

How am I going to set my router to forward port 80/8081 to 192.168.1.35:8081?
There is one option about it, but I don't know how to use it.

http://s1.picofile.com/file/7707805799/ … _wimax.png

Offline

#22 2013-03-29 21:53:55

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,783
Website

Re: Can't have access to my apache installed computer remotely


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#23 2013-03-29 23:04:16

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: Can't have access to my apache installed computer remotely

armb78 wrote:

How am I going to set my router to forward port 80/8081 to 192.168.1.35:8081?
There is one option about it, but I don't know how to use it.

http://s1.picofile.com/file/7707805799/ … _wimax.png

you need to start researching a bit more before you ask people on the forums to spoonfeed you everything. At least show some effort and ask questions when you get stuck.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#24 2013-03-30 11:37:57

armb78
Member
Registered: 2012-12-26
Posts: 29

Re: Can't have access to my apache installed computer remotely

Hey, I'm trying, but I don't know about networking. I still have no idea what the problem is, and you're telling me not to ask anything?
oh, and, I don't have 30 dollars to automatically forward ports!

Offline

#25 2013-03-30 13:25:15

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,783
Website

Re: Can't have access to my apache installed computer remotely

Use the free guides on that website then?


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB