?
Solved

How to use PC as a web server

Posted on 2010-01-05
23
Medium Priority
?
478 Views
Last Modified: 2012-05-08
Hi All,

I installed XAMPP to use my PC as a web server. It works fine. I can reach the web site internally and externally. I have two question about this;

1- When I try to open the website by using my external IP address, I can display the web page without errors. However, someone who is using different external IP address, try to open my web page, they can see only text version of my website. They could not see the pictures in the web pages.

2- I have a registered domain name. That is why, I would like to use this domain name instead of my external IP address. Is it possible? if so, How?


** XAMPP works on Ubuntu OS.

Thanks in advance.

0
Comment
Question by:Delidumrul
  • 10
  • 9
  • 3
  • +1
23 Comments
 
LVL 29

Expert Comment

by:fosiul01
ID: 26178314

2- I have a registered domain name. That is why, I would like to use this domain name instead of my external IP address. Is it possible? if so, How?  :

yes, to do this, you need to setup A record which will point to your ip address of your server

In domain control panel, there would be an option call , change A record, you need to point your IP to the A record

after doing this, when some one will type : http://www.yourdomain.com
it will go to your server



1- When I try to open the website by using my external IP address, I can display the web page without errors. However, someone who is using different external IP address, try to open my web page, they can see only text version of my website. They could not see the pictures in the web pages.   ::

I am not clear about this question. how many ip address you got ??


0
 

Author Comment

by:Delidumrul
ID: 26178427
Thanks for your response,

I only have got one external IP address. I meant that if someone types my external IP address to display my webpage, they can only see text version of the webpage. To fix this problem, I made folders' permission 777. However, nothing happens.
0
 
LVL 15

Expert Comment

by:Insoftservice
ID: 26178488
hi,

have u put ur domain name in ur host.conf of ur system and xampp.

if yes than check ur document root path.


0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 29

Expert Comment

by:fosiul01
ID: 26178492
ok

Example : your external (public Ip) is 88.22.26.35

now if you type : http://88.22.26.35  : you can view without any problem (  here you are viewing out side of your network)

but if your friends type : http://88.22.26.35 , they can view pages but not picture?? is that right ???



I made folders' permission 777.  : its not a solution, you should check error log , to see what causing the problem, check the error log first
0
 
LVL 3

Expert Comment

by:Hind987
ID: 26178495
IT is possible

If u have control panel we do it
Normally we create A record for a domain pointing to your respective id.
In the same add A record to for an ip address for which your domain is pointing.

This is only possible if you have control panel access where u can change your domain pointing and records.
0
 

Author Comment

by:Delidumrul
ID: 26178526
" but if your friends type : http://88.22.26.35 , they can view pages but not picture?? is that right ??? "

Yep, it is right. they only view text version of pages. they can see and read the texts in the web page. but They can not see the pictures such as header.
0
 

Author Comment

by:Delidumrul
ID: 26178560
@ Hind987:

I have just checked the control panel. Unfortunately, I can modify the domain settings. I will contact to hosting company.

@insoftservice:

"have u put ur domain name in ur host.conf of ur system and xampp."

Could you please tell me where host.conf file is located?

Thanks for both response.
0
 
LVL 29

Expert Comment

by:fosiul01
ID: 26178566
Yep, it is right. : Ok one more : From out side of your network if you type  http://88.22.26.35 , you can view everything fine, but when your friend type http://88.22.26.35  they can only view text .

does every one has this problem ??? or only one friend??

also, have you checked the error log file ???
0
 
LVL 29

Expert Comment

by:fosiul01
ID: 26178576
"have u put ur domain name in ur host.conf of ur system and xampp."  Currently he dont have domain name, he is browsing by IP only. when you will have domain name example www.yourdomain.com

then you need to insert domian name if your virtual host file


0
 

Author Comment

by:Delidumrul
ID: 26178643
Only one friend of mine tried to view the page. I am looking for proxy server to try it. I don't know how to check the error log file :?
0
 
LVL 29

Expert Comment

by:fosiul01
ID: 26178662
I installed apache by source, never used  XAMPP

for apache, its /usr/local/apache/logs Directory

there should be something like Error_log

may be other Experts who use XAMPP, would be able to say exactly. but check the XAMPP ( related directory) for error.log file


0
 
LVL 29

Expert Comment

by:fosiul01
ID: 26178663
also.. is there any way to get the IP address?? instead of typing full ip , type in word like,  two three four dot there four two ....
but its up to you, if you dont want to show IP, thats fine
0
 
LVL 15

Expert Comment

by:Insoftservice
ID: 26178883
hi,

xampp/apache/conf/httpd.conf

since ur using ubuntu

for system httpdf.conf
you have to /etc/resolve.conf

0
 

Author Comment

by:Delidumrul
ID: 26184748
Hi

I attached the text version of the website. My friend can view the website like the following pictures. By the way, I am using Wordpress 2.9. Additionally, when I put .swf file in the server, everything works fine.  
47838272.jpg
0
 
LVL 15

Expert Comment

by:Insoftservice
ID: 26187657
hi,

Just print ur image  & stylesheet path and check whether its same or not.

0
 
LVL 29

Expert Comment

by:fosiul01
ID: 26188350
Good morning

as i said, did try with some body else ??? it could be , there is some problem of cache of your friends computer???


and what abt error log?? have you tryed??
0
 

Author Comment

by:Delidumrul
ID: 26209047
I am very sorry for posting late. The first problem was solved. I am currently using joomla instead of wordpress. At the moment, I am dealing with A level records in the godady account. The problem is that IP Address showing up instead of domain name. The question is that  how can I set an "A" record in the DNS for my domain that points to your static ip address?

Thanks a lot,
0
 
LVL 29

Expert Comment

by:fosiul01
ID: 26209105
The question is that  how can I set an "A" record in the DNS for my domain that points to your static ip address? :

From godady account, change the A record . In the godady control panel, there would be an options to change A record
just point the A record to your public IP
it will work

then ... in your LAMP, you will gave to create a virtual host for the domain
0
 

Author Comment

by:Delidumrul
ID: 26209278
Hi fosiul01,

I changed the A level record. "in LAMP, you will gave to create a virtual host for the domain" I dont know how to create a virtual host for domain. Could you please explain it again?
0
 
LVL 29

Expert Comment

by:fosiul01
ID: 26209379
normally , we create virtual host like this

Normally, with intalled from apache source, we create virtual host like this

ref:
http://httpd.apache.org/docs/2.0/vhosts/name-based.html
under httpd.conf(under /etc/httpd/conf/) file or httpd-vhost.conf(under /usr/loal/apache/conf/extra) file



NameVirtualHost *:80
         
         <VirtualHost *:80>
                      ServerName www.domain.tld
             ServerAlias domain.tld *.domain.tld
             DocumentRoot /www/domain
                  </VirtualHost>
         
         <VirtualHost *:80>
         ServerName www.otherdomain.tld
             DocumentRoot /www/otherdomain
                  </VirtualHost>

but you used  XAMPP

this website is for XAMP
http://aminesoft.wordpress.com/tag/how-to-create-xampp-virtual-host-for-domain/

see if this helps

There woudl be httpd.conf file..
either you will have to write in httpd.conf or

httpd-vhost

you need to find out which file to edit
0
 

Author Comment

by:Delidumrul
ID: 26209810
I've almost done it. What do I need to write instead of "www,yourname.com" in the following code;

ServerName www.yourname.com
DocumentRoot /home/username/website/www.yourname.com

<Directory /home/username/website/www.yourname.com>

** I used my domain name instead of www.yourname.com for three lines. but it doesnt work:/


0
 
LVL 29

Accepted Solution

by:
fosiul01 earned 1000 total points
ID: 26210209
Make sure

NameVirtualHost :80        : is enabled        
         
and it would be same like bellow :


         <VirtualHost *:80>
                      ServerName www.domain.com
             ServerAlias domain.com
             DocumentRoot /www/domain
                  </VirtualHost>


then restart your apache


try by browssing : www.yourdoain.com and youurdomian.com


0
 

Author Closing Comment

by:Delidumrul
ID: 31672798
thanks for your help
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses
Course of the Month17 days, 9 hours left to enroll

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question