Jump to content

Live Site Home URL


Gazley
 Share

Recommended Posts

Hi there,

Yep, this is a pretty dumb@$$ed question but I'll ask it anyway :)

In the CP, my very top level is "Home".

Against localhost, my browser URL shows:

http://localhost:8888/ProcessWire/

When the site goes live, in this case, I want it to show something like:

http://my-funky-new-site.co.uk/

Assuming I specify that the VirtualHost DocumentRoot value includes the "ProcessWire" folder (or whatever comparable folder it is on the server), will PW automatically handle/show the URL like:

http://my-funky-new-site.co.uk/

Thanks!

Link to comment
Share on other sites

PW doesn't care where you run it or whether you move it between subdirectories, etc. So you should be fine. The only thing you need to consider is local links you may have in a TinyMCE field. Since that is raw HTML that TinyMCE uses, it may have direct links in it (if you've inserted images or links through TinyMCE). In that case, you'd want to do an search/replace on your DB dump file replacing "/ProcessWire/" with "/", before importing to your live site. There is also a module that can manage this for you called PageLinkAbstractor (currently being re-worked under the name LinkManager). But this module is one you have to start with and stick with, so probably not as helpful here. But I usually just do the search/replace when migrating from a local subdirectory site to a live root level site. Again, only necessary if you've got image, file or URL links in your TinyMCE rich text fields and are switching from subdir to root.

  • Like 1
Link to comment
Share on other sites

Just to make sure; I assume that http://my-funky-new-site.co.uk/ points directly to your docroot on the webserver?

In that case you would upload the contents of your ProcessWire to the docroot and not the directory and it's contents. In other words, normally there won't be a ProcessWire dir on your live site. Only site and wire dirs and ofcourse .htaccess etc.

Maybe obvious but thought i'd mention it.

Link to comment
Share on other sites

Hi SiNNuT,

Thanks for chiming in. Well, this was really the nub of the question. If I did include ProcessWire in the docroot, then in the VirtualHost setting for the site, I would have set the DocumentRoot value to something like "/var/www/htdocs/ProcessWire". In this case, I assume that would work.

Other than that, "/var/www/htdocs/" would contain only "site", "wire" and ".htaccess" as you suggest. I guess that by keeping "site", "wire" and ".htaccess" in a site-specific subdirectory off of the docroot, I could potentially have more than one PW site hosted by my dedicated server.

Does all this sound about right to you?

Cheers! :)

Link to comment
Share on other sites

Basically you can put the PW anywhere. But if you want "clean" domain (no subdirectories) then just make sure you point your docroot where your index.php is (and wire and site directories).

You can even "nest" pw installations. You can run one site at www.cooldomain.com and yet another at www.cooldomain.com/subsite/. It just doesn't care. Coolest part of that: http://processwire.com/api/include/

Other than that, "/var/www/htdocs/" would contain only "site", "wire" and ".htaccess" as you suggest. I guess that by keeping "site", "wire" and ".htaccess" in a site-specific subdirectory off of the docroot, I could potentially have more than one PW site hosted by my dedicated server.

I would but it this way:

/var/www/htdocs/coolsite.com/

/var/www/htdocs/anothersite.com/

etc.. (also you might want to make the path simpler, like /www/coolsite.com/ etc..)

This way it is clean and simple, and allows multiple domains/sites from your server.

  • Like 1
Link to comment
Share on other sites

/var/www/htdocs/coolsite.com/

/var/www/htdocs/anothersite.com/

So, two VirtualHost files specifying docroots matching the above paths, with wire/site/index.php in each folder. Cool!

Thanks apeisa :)

Link to comment
Share on other sites

This is quite an interesting topic. Up until now i have only deployed to shared hosting with all of the stuff directly in the docroot.

Sometimes you read that it is considered 'wise' to have as much as possible outside of the document root and maybe only keep an index.php and htaccess and your assets in there.

Any of you work this way? That would mean altering the paths in PW but i guess it could be done?

Link to comment
Share on other sites

Sometimes you read that it is considered 'wise' to have as much as possible outside of the document root and maybe only keep an index.php and htaccess and your assets in there. Any of you work this way? That would mean altering the paths in PW but i guess it could be done?

This isn't far off from what PW is trying to do, at least relative to other systems out there. The only things we have in root are:

/index.php

/wire/

/site/

/.htaccess

There are a few readme/txt files in there, which of course are just for initial reference and don't need to stick around with the site.

It is no problem to make your /wire/ a symlink to a shared /wire/ directory located somewhere else. But probably best to keep /site/ where it is.

Link to comment
Share on other sites

  • 9 years later...

I put the site, wire, .htaccess and index.php in my docroot folder and also made sure to give read and write permissions to the necessary folders which is site/assets, site/modules, site/assets/cache, site/assets/files, site/assets/logs. But when I open the website domain, I get these errors. My docroot points to /var/www/html/test_website.


Warning: file_put_contents(/var/www/html/test_website/site/assets/cache/FileCompiler/site/templates/home.php): failed to open stream: Permission denied in /var/www/html/test_website/wire/core/FileCompiler.php on line 400

Warning: fopen(/var/www/html/test_website/site/assets/logs/file-compiler.txt): failed to open stream: Permission denied in /var/www/html/test_website/wire/core/FileLog.php on line 164

Anything I might be missing?

Link to comment
Share on other sites

On 10/5/2021 at 5:12 AM, Siddhi Jagtap said:

I put the site, wire, .htaccess and index.php in my docroot folder and also made sure to give read and write permissions to the necessary folders which is site/assets, site/modules, site/assets/cache, site/assets/files, site/assets/logs. But when I open the website domain, I get these errors. My docroot points to /var/www/html/test_website.


Warning: file_put_contents(/var/www/html/test_website/site/assets/cache/FileCompiler/site/templates/home.php): failed to open stream: Permission denied in /var/www/html/test_website/wire/core/FileCompiler.php on line 400

Warning: fopen(/var/www/html/test_website/site/assets/logs/file-compiler.txt): failed to open stream: Permission denied in /var/www/html/test_website/wire/core/FileLog.php on line 164

Anything I might be missing?

@Siddhi Jagtap is this still an issue for you ?  thought you have fixed it. 

Link to comment
Share on other sites

  • 3 weeks later...
On 10/4/2021 at 11:12 PM, Siddhi Jagtap said:

I put the site, wire, .htaccess and index.php in my docroot folder and also made sure to give read and write permissions to the necessary folders which is site/assets, site/modules, site/assets/cache, site/assets/files, site/assets/logs. But when I open the website domain, I get these errors. My docroot points to /var/www/html/test_website.


Warning: file_put_contents(/var/www/html/test_website/site/assets/cache/FileCompiler/site/templates/home.php): failed to open stream: Permission denied in /var/www/html/test_website/wire/core/FileCompiler.php on line 400

Warning: fopen(/var/www/html/test_website/site/assets/logs/file-compiler.txt): failed to open stream: Permission denied in /var/www/html/test_website/wire/core/FileLog.php on line 164

Anything I might be missing?

On 10/6/2021 at 3:44 AM, JeevanisM said:

@Siddhi Jagtap is this still an issue for you ?  thought you have fixed it. 

Hello all!

I figured it would be okay to post this here since the quoted post was recent and it's related.

Okay, for starters, I'm very inexperienced with PW.  Due to this, I installed PW using my hoster's (https://ibrave.io/) so called "One-Click Install", which appears to have placed site, wire, .htaccess, and index.php in the public_html dir.  Because there is one level above the public_html dir that contains only the public_html dir and another .htacess file, I'm assuming it's the "root".  Please advise if this is incorrect?

After creating the required database file and running the One-Click installation, I created a new directory "Original" and  copied the contents of root to it.  Because I wanted a localhost duplicate, I FTP'd  the contents of the "Original" directory to
C:\xampp\htdocs on my PC to play with using XAMPP.

I realize I will most likely need to modify some of the local config files to get it to function.  Does anyone have a link to a list of which files and what modifications?  Also, if there are any reasons that this is a bad idea, please let me know.

Thanks!

 
 
 

 
 
 

 
 
Link to comment
Share on other sites

11 hours ago, Gideon So said:

Hi @nozero

I believe the only file you need to modify is config.php.

You need to modify the following:

1. $config->httpHosts

I wonder if your hosting company allow remote access to the DB server.

Gideon

Gideon,

Thanks for the info!  I will check with iBrave.io on remote access to the DB.

nozero

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...