Apache not loading CSS files on remote browsers but works on localhost - apache

I have an ubuntu installation on my laptop i use for web app development. When i type in http://localhost/blah.php i see my php web page as i normally would with all css style loaded and rendering fine.
When i try to connect to this same apache server from a remote machine by typing in the IP address the page loads but without any css styling at all. I also get the same problem trying to connect to the apache server from a virtual machine on the same box. I would like to get this working so i can test my web apps in IE but obviously css not loading is a problem. Any tips ?

Look into your source code and look how your style sheets are referenced.
If you have references to http://localhost/mystylesheet.css, that's your problem right there.
If that doesn't help, try to access a style sheet directly (enter the address in the browser) and tell us what happens. Also post the URL you are using. The head of the HTML document you are calling would also be helpful.

Related

Is there a difference in page paths when on localhost verses deployed?

My app is created in next.js and works great in localhost. When I deployed it in heroku, only the front page shows up and all page paths do not work even though they are correctly inputted in the browser. The only page that is connected to the index.js file in my page paths is the front page. Do the other pages need to also be connected to the indec.js file? I am terribly lost with this issue since the site works perfectly in localhost. In heroku every page path besides / has a 404 error. I didn't add any code to this question since no one file seems relevant to the issue. I've been searching all over for an answer to this issue but can't seem to find any relevant information online since the app is deployed successfully it just won't render any file paths besides /.
Thank you in advance for any help you can offer. I really appreciate it!
Applications are ran differently on localhost and when deployed to the server. Since you added react tag on the post, I assume you are trying to deploy react native app on Heroku, there is lots of information on internet how to do it.
For example this post.
Anyway first you need to build your app correctly, so static files would be generated (you didn't mentioned how you are running that app).
To your question:
Relative paths are the same on both local and server, but absolute paths will be different.
But for your 404 error I see that no static content are found on the root path.

Firefox not displaying PDF in primefaces p:media component on a remote server

I have a JSF application that uses Primefaces 7.0. Some of its pages use the p:media component to display the content of PDF files. When installed on a remote linux server, the application does not show the content of the PDF if used with Firefox 67.0. It works fine with Chrome and IE. And it works perfectly on my Windows 10 PC, even with Firefox. To make it even wierder, inspecting the element makes it visible in my laptop, but not in my desktop computer. Has anyone else a similar problem? Please advice.
EDIT 11/11/2019: Today I learned that the problem occurs when using https instead of http. Therefore, it doesn't really matter that the server is remote; what happens is that on our remote (and public) server we use https

How to preview a static site?

With Ruby on Rails I can run rails s -p 3000 and preview my site at localhost:3000.
With React I can run npm start and view the site at localhost:8080.
What if I just have html and CSS files, how do I preview that?
On OSX, you can run a simple web server from any directory using this command:
python -m SimpleHTTPServer 8000
Then, you can hit the directory in your browser by going to http://localhost:8000/path/to/file.html
You can try click 2 times in index.html to open the file in browser.
Every time you update the code in sublime text, you need to reload the browser and the updates will be aplied.
This usually depends on your device/OS and what your eventual goals are, but usually you can either use (online) software that renders the HTML and the CSS for you (such as Brackets.io, etc.) whilst you are typing it (to live preview any modifications/additions), or you can put the documents live using a local webserver such as Xampp or OSXs built in simple web server, and check their respective localhost locations every time you save changes using your code editor.
You could also simply use online applications like Codepen, which can also render HTML and CSS, and even JavaScript. Codepen just today launched Codepen Projects which allows you to create entire website projects at their website. It is however, a pro (paid) feature.
Here's a short overview of code playgrounds that offer the functionality you requested (by no means an exhaustive list):
JSFiddle
CSSDeck
CodePen
JSBin
And ofcourse you can insert Snippets here on StackOverflow, which is also able to render HTML and CSS (and JS).
If you really only use HTML and CSS, previewing in a browser is also possible, opening the .html file by double clicking and opening in Internet Explorer, Chrome, etc.

How to use File:// with a folder which is not in the Repository

I am new to Trac so be patient with me.
I installed Trac with the Bitnami installer in a Windows8.1 Virtual Machine on my Server.
Now to my Problem, I want to create "downloadable" links inside my wiki pages.
To create the link i use the [File://] command.
I have the correct link (in this case: [file:///Z:/Software/NotepadPlusPlus.exe]).
In my wikipage I have this: [file:///Z:/Software/NotepadPlusPlus.exe NotepadPlusPlus] and in the Internet Explorer it works perfectly fine but not on Firefox and Google Chrome.
When i copy the Link and Enter it in the those browser, it works. But when I click on the link inside trac, nothing happens.
I hope you can help me or give me a tipp.
You should put the files in a location that is served by your web server and use project-relative URLs and the HTTP protocol rather than the file protocol. The link rendering is just too browser-specific.
(barely copy-pasted this from comment by user rjollos, to formally get this question out of unanswered state)

TinyMCE link browser throws connection issue

I am using TinyMCE with Modx Revo (2.1.3). When I want to add an internal file (say a PDF) via a link, I highlight the text, click the chain link icon and then the browse icon. However, instead of showing a list of existing files on my server I get a server connection error message.
I have tried this on multiple browsers and machines and get the same results.
Does anyone know if there is a file path or any permission I need to change to get this working?
I rescently had some troubles with the tinymce file browser complaining about lack of access while the regular modx explorer worked fine. The problem was a domain plugin changing contexts on pageload, changing from "mgr" to "web".
Make sure you dont have any plugins doing something similar, and that you dont have any context settings with weird site_url settings or something like that.