Chromium DocumentRoot browsing file:// - local

I'm looking for a way to set the DocumentRoot while browsing local file:// sites.
My situation:
I have a copy of my web server on my local machine and sync it via rsync to the server. I'm looking for a way to check these site (while offline, so I can't just sync them) without installing a local web server.
I can open the files, but all links beginning at the DocumentRoot are broken.
What I'm looking for:
A switch like "chromium --doc-root=/home/user/website/http/" or similar would be perfect.
Is there anything like this?
Thanks for your help.

AFAIK, I don't think Chromium provides such options to specify document root for file scheme, which is also obey the file URI scheme (http://en.wikipedia.org/wiki/File_URI_scheme).
For your case, I think it's better to use a simple http server (e.g. if you have python, just use SimpleHTTPServer).
Ff file scheme is used, you still have to append --allow-file-access-from-files to avoid permission restrictions.

Related

MAMP/WAMP - Switch back from real project URLs to localhost in all my files

Good morning,
does anyone know how I could configure MAMP (or WAMP) in order to automatically change my project URLs, to localhost without having to search/replace inside my documents (operation I suppose to be a bit gross because possibly altering my code).
My goal is to develop on local while keeping the final and real URLs in my documents.I suppose lot of you have encountered this issue one day :)
In other word, I would like to alternate between online and local more easily.
I a beginner, please consider,
for all the biginners, here's the thing. I've created a config.php file which contains constants: one config file for the local project folder and one for the online server folder.
Inside this config file, I've create a constant (constant are then available everywhere in the project) to define the main URL of the project. e.g.:
define('CST_MAIN_URL',http://www.myproject.com); // for the online config.php file
define('CST_MAIN_URL',http://localhost:8888); // for the local config.php file
Thus, each header or redirection can work with that constant, like:
header('location:' . CST_MAIN_URL . 'index.php');
Then, things must have to do with RewriteEngine in your htaccess file, for instance whenever you must modify the behavior of MAMP/WAMP if an interrogation point or a slash provokes you with its malicious resistance. But, unfortunately RegEx expression must be understood as a basic level for mastering those url rewritings.
Hope it'll helps.

Contao Backend Styling / layout missing

Hi contao developer out there,
Anybody knows why the styling of the whole admin backend's missing.
I attach a screenshot, let me know if anyone knows something.
enter image description here
Looks like you have installled your Contao into a sub directory and setup your base url incorrect.
Have a look into system/config/pathconfig.php and verify the path is the same as in your browser (i.e. return ''; for an installation in the root dir and return '/some-dir'; for an installation in an subdir).
You should also check with web-developer tools as to which URLs for the Backend CSS it tries to load. Usually this already points out what in the base url is wrong.
Last thing, you might have set up some "strange" rewrite rules in your .htaccess file which may cause these problems.
Problem solved.
The fact that, the problem comes from the server configuration.
The Php process wasn't have enough permission, so it takes me some time to realise and knowing that I need to change the apache modul version to cgi/fpm mode.
This grants the php to recreate and generate the assets including js/css in asset folder. (at least from my own observation) and it works now.

Ol3-Cesium Example not working when run from local PC

I can view the OL3-Cesium examples from the website online perfectly.
When I view this example, I get the 3D view when I click on enable/disable button.
Now I have downloaded the release folder. When I try to view the same example from the examples folder, the example does not work the same.
This is the output when I open main.html from my system:
I don't know if I am missing something here
The overall problem is that you are running the example directly from the filesystem. The directory needs to be hosted under a web server, even the most basic server will do. For example, if you have python installed, just run python -m SimpleHTTPServer in the root and browse to http://localhost:8000/.
The exact problem you are seeing is that the default imagery provider is configured to use the same URI protocol as the site being visited, i.e. if you are at an http site, it uses http. If you are at https, it uses https. Since you opened directly from disk, you are using file://, which causes the imagery to try and use file:// as well. Since you have no such imagery on your system nothing shows up in the globe.
It is technically possible to use Cesium and Open Layers completely offline, but care must be taken and it looks like that example was not written with it in mind.

Add link to open a local file in Google Docs

I have made a guide (or something like a tutorial) about my tool to share with my company. I used Google Docs to do that, and I would like to add links to open video guides. I want to know a way to add link in the document.
What I do is the following. Links in sheets ( or in your case Docs) only respond to internet protocols e.g. HTTP://, HTTPS:// and so on... . It does not respond to file explorer protocols (like excel or word does) e.g. file:\\ or C:\.
So I installed WampServer (any other server will do as well, I just use this) and then copied the files into the WWW folder.
Now you can link to files that way. Google Docs/Sheets accept links to localhost as acceptable files to establish a link.
Be aware, your server will have to be online for the links to work. But this is how I solved my problem without uploading items to the cloud that I want to keep private and still use in google docs.
This is just for my local computer, if you want to share the doc with others in a local environment a little more understanding of your local server operations will be needed (i.e. do not use localhost, but refer to your IP-address).
The server can be scale-able on your local network as well, at this point a little more education will be required.
However, if you want to share the doc with others around the world this will not work at all
What I do is upload the files on Google Drive, and post the shareable link on Google Doc. Works like a charm!
Try Redirector.
It's simple Chrome/Firefox add-on for redirections. You can add before your path "http://" - Google Doc will be OK with that, then just configure redirection rule in addon. Rule can include wildcard or regular expression.

Paths on development and live servers

I'm looking for some advice, I currently use MAMP on locahost and have all of my websites in the htdocs folder. I use Codenighter mainly so when adding in paths for links, images etc I use <?php echo base_url(); ?> which is great for using the same code across live and dev.
I was wondering how I can link through to files from within a javascript file and preserve the paths when taking the site up to the live server?
I'm unable to put in absolute paths such as /controller/ as this doesn't work within the MAMP htdocs folder - I have to use /mysite/controller/ instead.
Is there a good way to preserve the paths when working across the two servers?
You should setup virtualhosts in Apache. By far the easiest way to do this is either get MAMP pro, or get VirtualHost X, the later is what I use. You can certainly setup virtual hosts in the Apache config but VirtualHost X adds the convenience factor.
So for instance if my live site is example.com then I setup a virtual host locally called example.local.

Resources