Deploying HTML file on Heroku? - html

I have a simple project consisting of three files which are the HTML, JavaScript and CSS files. I did everything on heroku which they said but then I got an error regarding some buildpack.
So I used this particular answer to fix it. answer
then when did the command
git push heroku master
I didn't get any error but when I did open app from Heroku, There was a 404 error and description was nginx. I don't why this is happening but please tell me where am I going wrong.
Thanks in advance!

You cant host static website on heroku the github pages will be better suitable
the best workaround is to trick the heroku that we are hosting the php app
convert nameindex.html to home.html
create index.php and write <?php include_once(“home.html”); ?> on it
add composer.json
and push to heroku

Related

Why does my GitPages website only show a 404 even though I am sure my code is not buggy?

My Git Website returns a 404 every time I run it. The only thing I can find is this: Conversion error: Jekyll::Converters::Scss encountered an error while converting'assets/css/style.scss': No such file or directory # dir_chdir - /github/workspace/docs
Someone please help.
My project: https://github.com/orivera2280/GetConnectedSix.git
Hello and welcome to StackOverflow. GitHub Pages is for static-file hosting (HTML, CSS, JS for the client-side, images, etc) and would not RUN the Python code for your Flask app, hence the 404 page. You would need a cloud-hosting platform like Heroku or AWS. Both offer a free tier.

How can I fix 404 error importing css on GitHub Pages?

I currently have the following Git Repository:
https://github.com/SebastianGode/ansible-collection-cloud/tree/gh-pages
And the GitHub Page link:
https://sebastiangode.github.io/ansible-collection-cloud/
The problem is that GitHub Pages will only solve the index.html and will throw an 404 for all required css and image stuff:
As the documentation is getting automatically generated by a travis-ci pipeline it's probably impossible to change paths, but as it works when hosted it locally it also should work on GitHub pages.
Is there any solution to this problem?
I fixed it.
GitHub has Jekyll running behind it which will mess up special paths (here the underscore paths). You can disable jekyll by just creating a .nojekyll file in the root directory of the branch. If you use travis-CI for something like that and run a tox script just call the command touch {toxinidir}/.nojekyll
This will result in a working website for me.

"Page Not Found" upon deploying site to Netlify via Github repo

I'm a complete beginner to web development and am trying to deploy my first site via Netlify. Despite my site working fine when being displayed from my local machine, I'm given the following error when navigating to my site's URL:
Page Not FoundLooks like you've followed a broken link or entered a URL that doesn't exist on this site.Back to our site
Since my page is functional on my local machine, I believe the error lies within my Github repo and/or my deploy settings. Here's my repo:
https://github.com/Cotton0419/TestSite
And my deploy settings:
Repository: github.com/Cotton0419/TestSite
Base directory: acme
Build command: Not set
Publish directory: acme/disp
Deploy log visibility: Logs are public
Any help would be greatly appreciated, I can supplement more information if need be.
The Base directory on Netlify is only used by the build environment for a reference to your code base (defaults to root of the repository if not given).
The Publish directory would be relative to the base directory. So in your case disp or acme/disp if using the default.
You are referencing assets in a location that does not exist in your published paths, so they would not exist in your deploy to the CDN.
<link rel="stylesheet" href="../css/style.css">
You should move your assets into your deploy disp folder and edit the correct paths into your code files.
Similar problem I encountered today. I decided to upload an old portfolio I had made a while back. Then for some reason after running the URL on Netlify, nothing happened. The only thing that showed up was a prompt similar to yours -
Page Not Found
Looks like you've followed a broken link or entered a URL that doesn't exist on this site.
Back to our site
After revisiting the HTML and CSS files, I realized that I had set the title for my HTML file to porfolio.html instead of index.html which solved my problem!
For this kind of error please kindly check the HTML filename change it into index.html it worked for me!

Tomcat Server wont load the Webpage

Im trying to deploy my WebApplication on a TomCat 9.0.11.
Now everything went good so far, the artifact was deployed into the ROOT directory, but the page just wont load, and doesnt shows up my index.html? Does anybody see the error here? If i forgot something please tell me so i can add the missing stuff.
EDIT: I want to run the server on Windows first, later on Debian. The website should also be accesibile trough example.com not f.e. example.com/app (or for Windows localhost not localhost/app)
TomcatConfiguration1
TomcatConfiguration2
Artifacts
ServerLog
TomcatServer after deployment
Trying to open the page
Greets
Lukas
i think project should be inside the webapp folder not inside root .Please attach log which can show us the context loading .
Or you can refer to this link:
Deploying just HTML, CSS webpage to Tomcat

Subdirectories in openshift project cannot be found

I built a site using a php openshift project and accessing the root directory via http works fine. However, all the root directories give me a 404 not found, like this one: http://test.toppagedesign.com/sites/
I checked with ssh, and /app-root/repo/sites and app-deployments/current/repo/sites/ both exist.
EDIT
Added a directory called php and now I have 503 errors for everything...
EDIT 2
I deleted the php directory, now the 503 errors are gone. However, I do still get 404 errors for the subdirectory.
Here is my directory tree: http://pastebin.com/hzPCsCua
And I do use git to deploy my project.
php is one of the alternate document roots that you can use, please see the March Release blog post here about this (https://www.openshift.com/blogs/openshift-online-march-2014-release-blog)
As for the sub-directories not working, can you ssh into your server and use the "tree" command to post the directory/file structure of your project? Also are you using Git to deploy your project or editing files directly on the server?
You need to have an index.php or index.html file in any directory that you want to work like app-domain.rhcloud.com/sites , if you just have sub-directories, how would it know what to show? Also, indexing (showing a folders contents) is not enabled for security reasons, and I believe there is no way to enable it.
This sounds like it could be a problem with how you are serving your static content.
I recently created a new sample app for OpenShift that includes:
a basic static folder
an .htaccess file (for serving assets in production)
support for using php's local server to handle the static content (in your dev environments)
Composer and Silex - a great starting point for most new PHP apps
You can serve the project locally if you have PHP-5.4 (or better), available in your dev environment:
php -S localhost:8080 -t static app.php
For a more advanced project that is built on the same foundation, take a look at this PHP+MongoDB mapping example. I wrote up a blog post with some notes on my process for composing that app as well.
Hope these examples help!