Photos are not showing up when using No-IP ddns and linux apache - html

I don't have a static IP address so a person recommended that I use no-ip.com
I did and now my website is accessible from external internet yay
The problem now is that my photos aren't showing, I thought this would have been a simple issue
I'm not sure if I have to do something with Virtual Host or...
My domain name is greenace92.ddns.net
I can access my index.html file, that shows up fine but the photos aren't showing
On my httpd.conf file I have
ServerRoot "/usr/local/apache2"
The html files are in htdocs under apache2
So, on virtual host that httpd-vhosts.conf file I have the following
ServerAdmin "jacobcun#ricekidengineer.com"
DocumentRoot "/usr/local/apache2/"
ServerName "www.greenace92.ddns.net"
*ricekidengineer.com is my other domain with email configured
I didn't change the error logs from stuck "dummy" stuff
So on my html file for image href's I have
http://www.greenace92.ddns.net/htdocs/images/normalbus-icon-on.png
I assume that www.greenace92.ddns.net is /usr/local/apache2
So I'm just continuing the directory location
Is that correct? What is wrong?
Yeah I don't understand, I even tried three different directories for a few photos, trying directly in apache2, then htdocs, then the images folder
What am I not seeing?

You will have to decide what your want as the domain for your site:
www.greenace92.ddns.net is not setup for your web site
greenace92.ddns.net is the domain setup for your web site.
You either have to
configure no-ip.com to point to the domain www.greenace92.ddns.net
(or)
change your apache ServerName directive to
ServerName "greenace92.ddns.net"
and change the image URLs in your HTML pages from something like
http://www.greenace92.ddns.net/htdocs/images/normalbus-icon-on.png
to
http://greenace92.ddns.net/images/normalbus-icon-on.png
Note: With your current configuration, the 2nd URL mentioned above should already work (It worked when I tested!).

Related

make public website reconnect to local html or xampp

Basically what I want to do is if I open this
http://steamcommunity.com/market
website on my pc I want to see a local website that is stored as html. I already tried to host the website with xampp which worked and trying to add
localhost/path http://steamcommunity.com/market
to my hosts file.
but instead of redirecting me to my local hosted html file it just loaded the steam market.
This is a two step process: first, you have to redirect the web site name to your computer; next, you get Apache to redirect the web site address to your installed directory.
Locate your hosts file,
Add lines containing the domain name(s) and IP address to redirect to.
Each line must begin with the address 127.0.0.1 (this is the localhost address)
After the IP address, type the name of the domain you wish to redirect to this address. You may only enter 1 name per line.
Addresses like my-site.com and www.my-site.com are different and each need a separate line.
Save the changes.
Next,
Locate the httpd-vhosts.conf file. For most XAMPP 1.7.3 installs this will be C:\xampp\apache\conf\extra
Add the new host,
<VirtualHost *:80>
ServerName www.joomla.16
ServerAlias joomla.16
DocumentRoot d:/xampp/htdocs/path/mysite
</VirtualHost>
Explanation of VirtualHost preparation,
ServerName: following this label, add the name of the domain you added in
ServerAlias: following this label, you may add as many alternate domains (separated by spaces) as you like that are supposed to resolve to this virtual host. Remember that www.my-domain.com is different from my-domain.com, but, typically, you would want them to resolve to the same server.
DocumentRoot: following this label, add the path where your website is located. You can use an absolute path (as in the example above), or a relative path (but relative paths can be trickier to set up, so I prefer to use an absolute path).
Restart Apache Web Server
You should now be able to type the domain name into your URL field and go directly to your locally hosted web site:
Please see this tutorial for more help.
No idea why you'd wanna do this, but your hostsfile should be:
127.0.0.1 www.steamcommcunity.com
::1 www.steamcommcunity.com
127.0.0.1 steamcommunity.com
::1 steamcommunity.com
Just to be on the safe side I've used both with and without www, and both IPv4 and IPv6

Redirect HTML "/" to subfolder of WWW directory, the VirtualHost DocumentRoot

Sorry for asking this question again. Even though this has been asked and discussed quite a bit I cannot seem to find the right solution for a local dev environment using VirtualHost. I am using XAMPP Portable for Windows for dev work but assume this is the same for any other local server with regards to the .htaccess file.
DocumentRoot of VirtualHost is D:\dev\www\ for example.
ServerName is devwork.webdev for example.
HOSTS entry is 127.0.0.1 devwork.webdev.
VirtualHost file does have a default DocumentRoot being DocumentRoot "D:/xampp/htdocs". It works just fine.
The projects are each in a folder under D:\dev\www\ for example D:\dev\www\project01\ or D:\dev\www\project02\ and so on and show nicely in the browser when going to devwork.webdev with Options Indexes FollowSymLinks enabled. Apache is not showing any error and the access log file is also OK, things are working.
Now in my HTML when I use Project 01 a click on the link does link me to D:\dev\www\ showing all the projects I have in that folder.
Instead I would like to be linked to the root of the project, being D:\dev\www\project01\ or rather http://devwork.webdev/project01/.
How can I get that to work?
I am looking for a solution to this so that I can do dev work locally and without changing the HTML later FTP the data to the live host's root and it will work.
I have read and tried the following:
http://coolestguidesontheplanet.com/redirecting-a-web-folder-directory-to-another-in-htaccess/
https://perishablepress.com/redirect-subdirectory-to-root-via-htaccess/ .htaccess How to redirect root URL to subdirectory files, rewrite to clean URL AND not affect subdomains?
http://alexcican.com/post/how-to-remove-php-html-htm-extensions-with-htaccess/
https://stackoverflow.com/a/990405/1010918
How to redirect /directory/index.html and /directory/index.php to /directory/
Redirecting /directory/index.html to /directory/
with
How to remove .html from URL
and
http://forums.modx.com/thread/77211/endless-friendly-url-redirect-from-subdomain-folder-location
being closest to what I think I need but I must be doing something wrong since I always arrive at the DocumentRoot instead of the folder where the project is kept under the DocumentRoot.
Thank you for any help.
This seems closest:
Add VirtualHost definition for each project you want to access. (I'm
not sure how to do it on XAMPP for Windows).
For example, project01.devwork.webdev...
Set DocumentRoot for this VirtualHost to D:\dev\www\project01...
Add the hostname to your /etc/hosts/ file.
Open http://project01.devwork.webdev/ in your browser.
You should see the application in D:\dev\www\project01, while all URLs
will be based on "/".
What happens in the background:
When you open the URL http://project01.devwork.webdev/ in your browser, it will (as usual) translate it to IP address, but along with the request, it will also send Host header with the entered hostname:
GET / HTTP/1.1
Host: project01.devwork.webdev
Based on the Host field, Apache will decide which VirtualHost it needs to "pretend" to be, and serve files from the respective direcory.
However, if you need to have index of the projects, you will have to create it manually with full URLs.
An alternative with the given logic would be to simply add a VirtualHost for each project in D:dev\www\projectname by giving it its own domain instead of a subdomain on the host.
There is little difference there now when already editing httpd-vhosts.conf (using XAMP this file is in InstallDir and then in apache\conf\extra )but ideally it makes copying the local HTML to the live server without changing the HTML possible.
So this is something devs doing local work should keep in mind. I certainly will!! Thank you for your help and information.
<VirtualHost *:80>
DocumentRoot "D:/dev/www/newprojectname"
ServerName newdomainname.webdev
ServerAlias www.newdomainname.webdev
ErrorLog "D:/dev/www/log/dev-apache.error.log"
CustomLog "D:/dev/www/log/dev-apache.access.log" common
<Directory "D:/dev/www/newprojectname">
AllowOverride All
Options Indexes FollowSymLinks
Require local
# more detailed local
# Require ip 192.168.188
# or the IP from your local network
</Directory>
</VirtualHost>

can't access wamp projects online

A lot of similar questions to mine,, but really none addresses my issue!
I installed Wamp on a pc (win 7) connected to internet and i gave it a real IP (78.10*..) in which i can access it anywhere.
i did the following:
changes in httpd & phpmyadmin,, (deny all replaced with allow all) (server name "localhost:80" replaced with my public ip 78.10*..:80) ( denied replaced with granted) (added ::1)
changes in phpsysinfo, sqlbuddy,webgrin (requier local host removed ,, deny from all replaced with allow from all)
-put wamp online from its icon
-firewall is turned off
-full permission granted on local hard C and put on shared too
when i request 78.10*.. on another computer (not in my LAN) the wamp index previewed and i can access Tools(phpinfo, phpmyadminn) & Your Aliases(phpmyadmin, phpsysinfo, sqlbuddy, webgrin) but i can't access my project which located in the www directory
when i press on project named "m" a redirect page previewed and redirected me to page named localhost and says page not available, if i did same thing on my server the redirected page redirect me to localhost and i can access my project
any help will be appreciated
Thanks in advice
Change (wwwroot='localhost') to 78.10*.***.*** in your "Config.php" inside your Moodle folder.
To make your moodle folder your root directory, do the following:
You will have to edit two things inside of the httpd.conf file /wamp/apache2/conf/httd.conf find:
DocumentRoot "/wamp/www"
change to
DocumentRoot "your_moodle_folder"
then find:
<Directory "wamp/www">
change to
<Directory "your_moodle_folder">
Save it and restart apache.

How to use root-relative URL's on Apache server without a domain name?

I have a staging server (VPS) that has a dedicated IP address. For example, http://numeric.ip.address/
I can access the the files in the public_html folder by doing the usual tilda thing in the URL - http://numeric.ip.address/~account/
I have a folder I've developed locally that uses root-relative paths to resources, but
when I load the file in the browser, those root-relative URL's jump up in the directory all the way to the root IP address, instead of the public_html folder /~account/.
I realize there are better ways to set up a staging server and I plan to do so in the future, but I'm facing a deadline where it would be really handy to make this work.
I've tried tossing a base href tag in header tags, but that isn't doing the trick.
In Apache, normally you have "VirtualHost" container or .htaccess file. In it, you set your domain and DocumentRoot.
From what you describe, all you need to do is set your DocumenRoot correctly to you root of your site. then in the Browser, you can point to your paths. So if you have folder called "finance" and inside that folder you have document call "report1.pdf", you can put in your browser, example.com/finance/report1.pdf -as long as you have your DocumentRoot and site setup correctly and put the files in correct path, Apache will serve the file.
<VirtualHost 10.1.2.3>
ServerName example.com
ServerAlias www.example.com # not necessary
DocumentRoot /www/docs/host.foo.com
...omitted the <Direcotry> </Directory> stuff
</VirtualHost>

AWS page just showing Apache Start page and not html file

I'm running an apache server on an Amazon EC2 basic linux instance, and I'm trying to get it to just display a simple test html file that I created. The file is in /home/ec2-user/public_html (just for test purposes). I've changed the DocumentRoot and Directory to point to this directory, but the public dns address is still just showing the default Apache start page. What else do I need to do/change to get this to actually display online?
Edit: I've also uncommented the VirtualHost *:80 line, changed the DocumentRoot and ServerName within the VirtualHost tags.
It turns out I had forgotten to change some permissions on the test.html file itself and that was causing a holdup.
check running instance's security group HTTP rule. ADD rule if not added:
Select HTTP from the Type list, and leave the source as Anywhere (0.0.0.0/0).