Web development with PuTTY and SSH: Why is the webpage I'm trying to change the code for linking to a deleted directory and not updating? - html

This is my first time trying web development and creating an actual website (not just a page on Repl or independent html/css page). I have a domain name, and the website connected to it that I'm trying to edit previously had some code on it.
I'm trying to use PuTTY and SSH to transfer the html and css files I want to the remote location.
However, this is what the user point-of-view looks like right now
I'm really confused because gittwo is a directory (with the html + css files I want) that I already deleted. I'm also confused why the main website shows a link to that directory instead of just displaying the image of the website I want. Before gittwo was deleted, it was directly under the main directory where code for the website should be.
Furthermore, now that gittwo is deleted, I'm wondering why the webpage still displays a link to that directory instead of showing the new directory I created, public_html. This is how the main directory looks like on Putty Do you know why this is happening?
I'm really new to all this and I know I'm confused about more things than one here and my question probably reflects that, so please let me know what parts I could maybe clarify!

Related

Files not showing in htdocs

When creating a new database through PHPMyAdmin and trying to access localhost/newdatabase, I get this message:
"Object not found! The requested URL was not found on this server. If
you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 404 localhost Apache/2.4.34 (Win32) OpenSSL/1.1.0i PHP/7.2.9"
The file doesn't show in xampp/htdocs either, only in xampp/mysql/data.
If i create files directly in htdocs, they work perfectly on localhost/.
Why has the file not been created in htdocs?
The content of the htdocs folder are files that can be interpreted by the browser such as HTML5, CSS, JS, etc... in order to show a webpage along with it's funcionality to whoever accesses it. A database in the other hand can't directly be opened by a browser, but rather accessed within the server by a backend language like PHP, in order to get the information that can be stored in it through tables. You seem to be new to web programming, so I'd recommend to quickly google some beginner tutorials that can help you to understand the most important concepts. To take on from your kind of confusion, I'd point you to expand your knowledge on these concepts:
HTML5
CSS
PHP
MySQL
Once you get the grasp of them and identify each by their core funcionality, you'll be good on your way to make webpages. Later on you'll find yourself with demands like making your webpage look nice and clear, and also to make it load fast, but there's time for everything and the concepts I pointed are the best start for you.
if you wanna open your database URL = http://localhost/phpmyadmin/
File directory ~ xampp/htdocs for source code such as extension file .php .html .js or other.
if you wanna load localhost a URL is http://localhost:80 (auto find index file to first load)
Sample given as image folder for my code. Hope that can help you to understand xampp

how to load HTML pages, from a location different from root, on the same server?

I am making my first web site with OSX; this is an internal website for my company.
When the server start, I load pages from a different location, from the one that OSX server used to create my template site (because I do redirects that go on the same IP address, so the pages of the redirect obscure the ones from OSX server). These pages are served by a product called Buildbot (a CI server).
Now, I load the main page from the python directory on my computer, and I would like to avoid to get all the pages for the server there, to not mix them up with the buildbot pages; so I am trying to use the directory that OSX server created for me.
The issue thou, is that I do not know how to link pages...HTML is something that I forgot with time; but I remember that each site starts from a root directory, so the computer is protected by outsiders that may try to force it.
Now, I assume that my root is where the start page is loaded from (in my case is /Library/Python/2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/status/web/templates/), so if I use an href to link to another page, I can just access to this tree.
Which means that my website should be in a folder in this path? I can't seem to access the site where OSX server created the website resource (which in my case is Library/Server/Web/Data/Sites/mySite/).
Has been so long since when I used HTML, so I am quite rusty on the topic, and would appreciate a lot any kind of hint. The site will not be available outside our internal network, so I simply need to link pages and resources scattered on my server HD, and put them on web pages.
Here's how I understand:
Let's say your web root is /root, but you want to have a href to an html file in /dog, for example. Is this correct?
Assuming so, you cannot link an HTML file that is not in the web root, as the browser needs to be able to access it. If you were using a server-side programming language you could do this, but not with HTML.

How can I find my working directory?

You'll have to bear with my slightly on this, but please ask if I have left out any pertinent information. I have just taken over a project to create a dashboard for my team. This dashboard has been made using a niche third-party tool that nobody here will have used before. The third party tool auto-generates some code to display "markers" on a webpage. "Markers" being some proprietary code to query a database/apply custom styling etc.
I am trying to display a webpage within the page that has been generated, and I’d like to point this to a local webpage (ie on my C drive). If I pass it an absolute path, then this results in a warning in IE9 as I am mixing data sources - a https website pointing to a http web page. It will display after ignoring the warning, but my userbase is not comfortable enough with computers to ask them to do this.
I believe if I pass it a relative path then it should work, but I can’t find out what directory to base this path off and it doesn’t appear to be anywhere obvious. So, in my current page I have an image with the web address of : https://website:8443/websitereport/images/buttons/locked.gif. What I need to know is where the “websitereport/images” folder is stored so that I can put my webpage in there to give the webpage a relative path. The HTML for this image is :
<img id="dvp_locationbar_lock" class="dvp_imagebutton" style="" dvp_title="ui.tip.lock-page" dvp_image="locationBarPageUnlockedImage" src="/websitereport/images/buttons/unlocked.gif" title="Lock this page">
What are my options for discovering where this folder is stored locally? I am running Apache Tomcat 7.0. It is not displaying if I use the path based off
C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\work\Catalina\websitereport
of
\websitereport\page.html
And I cannot find it anywhere obvious in the Apache folder. I have tried :
Searching - no results.
Using PHP to print the current working directory - cannot find out
where to edit the webpage.
Looking at images/information on the existing webpage. They all point
to folders I cannot find.
Inspecting with firebug.
In short, you can't rely on the files being on disk at all - they might be just contained in a *.war file, containing the whole application. Or they might be generated on-the-fly, despite the name sounding like an actual file.
Also, you should not arbitrarily write within a directory even if you find it (my closest guess would be tomcat's webapps/websitereport/ directory if it exists) because nobody will know that something changed during the time since last deployment. So, on the next update of the application, you'll end up overwriting all of your changes again. You typically change the underlying application and redeploy.
You might also find a few references in tomcat's conf/localhost/ directory or even in conf/server.xml, but it all depends on how your server was administered

Simple HTML directory/index.html issue

I feel like a baby for having to do this but bear with me. I'm trying to set up webpage structures on my desktop in a folder. It's got an index.html and a couple folders of its own. One folder, "research", has its own index.html. I'm trying to link to this page from the higher index.html with but instead of taking me to research/index.html it takes me to a 'file-directory view' (for lack of knowing what to call it) of the directory research/
Clearly I could fix this by doing but that's annoying. Thoughts?
if you want to browse locally, you will have to include the file name. in other words:
<a href='research/index.html'>research</a>
The reason it works on remote servers is because replacement is done by the web server so if you want research/ to work then you will need a local web server such as wamp on windows or mamp on mac.

Some images won't show when moved Wordpress site to another domain on same server

I've developed a new wordpress website on a testing domain name on our server.
I had set the site up ready to go live... but I had to move the wordpress website onto another domain name that we are also hosting on our server.
So what I did was copy all root folder content from the testing domain name and pasted the content into the new domain name's root folder.
I then logged into wordpress, changed all the necessary settings like WORDPRESS URL and SITE ADDRESS URL as well as image absolute urls in each and every individual pages to make sure that I've got the right URL for everything.
When I click on MEDIA, I can see all the images like normal.
Great ... then I go and check the website live and I see that there are a lot of images that are missing! They are all in the MEDIA panel - but do not show up on the website!
I then double check that all images are pathed correctly ... and they all are.
Now why do SOME images show up and others don't?
I've even tried to add a new photo and use that photo in place of another photo that isn't showing up and that new photo doesn't even show up.
Where does my problem lie?
For example, 1 slideshow on my website which isn't showing images, give me an "image not found" error for a image:
Image not found: http://www.domain.com/wp-content/themes/natural
/lib/timthumb.php?src=http://www.domain.com/wp-content/uploads/2012/08/breakfast-gallery-011.jpg&w=610&h=0&zc=1
Ok I am going to answer my question with some advice.
It's clear that some of my images were 'hard coded' as devin mentioned as I could not find a logical reason for some not showing (even when I looked at the tabular data in MySQL) and because I'm not a database engineer / developer - I wasn't prepared to dive too deep into that with the possibility of causing further issues... so I decided to take down the entire wordpress site, create a new database, re-install wordpress and I imported an exported xml file that I created and saved (luckily) before 'migrating sites'.
Advice:
1) Whether you migrate a wordpress site or not, always backup your website regularly by creating an export of your wordpress structure. It may save you a lot of work in future.
2) If you're an amateur or beginner at development and MYSQL like myself, I'd suggest you create your wordpress site on the actual domain name you want it on. This will save you from 'migration' headaches as I've just experienced ... and a lot of time. Learn from my mistakes. Although there is probably a solution to my question above, it's out of my expertise / knowledge and could be out of yours too... so make it easy for yourself :)
The issue is not that the image URls are hardcoded only. The last portion of the URL is harcoded, but you will most likely have "/wp-content/" embedded in the URL which indicates that the image's URL string is dynamically created. I looked in my wp_postmeta table and there were all of the partial image URls ( like this - 2013/03/expanse2.jpg ). Now where is the beginning part of this URL and the domain name? The domain name is the part that is actually missing from the all of the image urls in my case. I dug into the database a little deeper using phpmyadmin ( but i recommend Webmin if you can get it up and running ). I ran into the "home" field in the "wp_options" table. Asked Google what a proper "home url" would be for wordpress, which brought me to this page ( http://codex.wordpress.org/Function_Reference/home_url ) , and this line was in there ( home_url() is located in wp-includes/link-template.php. ). Went to that file and found that it controls how URLs are built, but not uploaded image urls specifically. In the end i went into a page that had an image, looked at the advanced settings and found the image URL was just missing the domain. I used the wonderful search and replace script to repair it. Done