Where to put SVN repository directory in Linux? - linux

I am setting up a new SVN server on Ubuntu Linux. Where is a good place (best practice) to put the repositories? Should I create a new user? The server will be accessed via http:// so no need to create user accounts etc (as was the case for svn://).
Many thanks in advance

I like putting things under /srv, as it seems to match the definition in the FHS.

The new location for service data according to the FHS is /srv, so under there would probably be best.

I've always used /var/svn or /var/lib/svn. While it doesn't quite line up with FHS, it matches closer to what the other apps actually do (On RHEL5, Apache uses /var/www; PostgreSQL uses /var/lib/pgsql). As suggested, /srv/svn looks like another good spot. And you get to say "Look, I'm following the standard!"
Using either /usr/svn or /usr/local/svn would probably be considered bad form, and all your Linux friends will laugh at you behind your back :-)

I host my SVN via the apache module, so I usually put it under my apache user, at the same level as my htdocs, and setup a specific authentication just for SVN users. Not under htdocs, but same level.
If you have a lot of projects, dedicate another volume to SVN since it will grow.

I guess I'm kind of old school but I like to put things (apache,tomcat,...etc) in /usr/local. So I will usually create repositories in /usr/local/svn and have the Apache module reference that path in the httpd.conf

/home/username/Dropbox
this way you backup the svn and can access it on a windows machine as well.

Related

Cpanel is not giving me option to change the root directory for one of my domains

I need to change the root directory for one of my domains,
But in my cpanel i dont find any options, just hard cores of system, but i have very basic knowledge about systems and servers.
How i can change that directory as easy as possible? I just need to change something because im gonna install laravel, and i want to change the public html to the public of laravel.
I was looking for the file that has the apache config, but it says like "the current config doesnt need to be changed or updated, bacause can be overryde", so i tought in Cpanel maybe i got an option for this.
Thanks, By the way i got an VPS, not shared. Using CENTOS 7.9.
Thanks and good night ^^
In cPanel, you can't change main domain directory/document root. If you want to change the document root, just change the main domain to another/random domain. Then add the domain that you want to change the root directory as addon domain
It's not recommended overriding Apache config. It's may break your system. WHM/cPanel exists to manage domains without a system admin knowledge
Do you try change this using console in Centos?
maybe will be better using console and open the file that contain the directory root

Does Ghostscript absolutely need root access on Linux?

I made a program trying to see how many color pages are on an uploaded PDF file, using Ghostscript. Now, it worked perfectly on my local environment, but I can't put the site online, as the web hosting service I use tells me that any application that needs root access cannot be installed on the server. Is it the case with Ghostscript, and if so, is there any other way I can use it ?
I'm new to all this, and I know now I should have asked the web hosting service first thing, but I'd really like to not have to put my work in the bin over this !
No Ghostscript doesn't require root privileges and I've no idea why they would claim it does. Also, I would strongly urge you to review the AGPL license.

Where to put PHP frameworks on Linux host

I have a Linux (CentOS) host that hosts 5 websites of mine. There are two different PHP frameworks (Yii & Zend), each of my sites is based on one of them. Where would be an appropriate place to keep them, with what permissions? I though of two variants but I have doubts that any of them is the right thing to do.
In my projects, which reside in for example /home/example.com/public_html/index.php I would do require_once($pathToFrameworkInitFile)
Variant 1:
Under /usr/local/, user root with permissions 755:
/usr/local/frameworks/yii/yii-1.1.9/
/usr/local/frameworks/yii/yii-1.1.10/
/usr/local/frameworks/zend/zend-1.11.12/
Variant 2:
Under user frameworks with permissions 755:
/home/frameworks/yii/yii-1.1.9/
/home/frameworks/yii/yii-1.1.10/
/home/frameworks/zend/zend-1.11.12/
Variant 3:
I hope that you might suggest something better.
As you suppose - I have full root access to the host and I'm managing both websites and host myself, so I'm looking for the best (or at least good enough) practice.
After reading more about the Unix FS Hierarchy Standard, I decided to put the frameworks in:
/opt/php-frameworks/yii-(version)
/opt/php-frameworks/zend-(version)
With permissions 755, under the root account. Most best practices say that the framework should be out of the docroot and /opt seems ideal for such libraries as php frameworks.
This is very subjective. You can put it where you want. I liked to put the webapplication in /opt/www/project or /var/www/project.
And I don't like to share the framework parts of the application. Think about moving a Project to a new Server, or updating the frameworks.
The owner has to be the user who changes the files. If you are root, then let root own the framework files.

How do I move ExpressionEngine (EE) to another server?

What are the best steps to take to prevent bugs and/or data loss in moving servers?
EDIT: Solved, but I should specify I mean in the typical shared hosting environment e.g. DreamHost or GoDaddy.
Bootstrap config is the smartest method (Newism has a free bootstrap config module). I think it works best on fresh installs myself, but ymmv.
If you've been given an existing EE system and need to move it, there are a few simple tools that can help:
REElocate: all the EE 2.x path and config options, in one place. Swap one URL for another in setup, check what's being set and push the button.
Greenery: Again, one module to rule them all. I've not used this but it's got a good rating.
So install, set permissions, move files and and DB, and then use either free module. If you find that not all the images or CSS instantly comes back online, check your template base paths (in template prefs) and permissions.
I'm also presuming you have access to the old DB. If not, and you can't add something simple like PHPMyAdmin to back it up, try:
Backup Pro(ish): A free backup module for files and db. Easy enough that you should introduce it to the site users (most never consider backups). All done through the EE CP. The zipped output can easily be moved to the new server.
The EE User Guide offers a reasonably extensive guide to Moving ExpressionEngine to Another Server and if you follow all of these steps then you will have everything you need to try again if any bugs or data loss occur.
Verify Server Compatibility
Synchronize Templates
Back-up Database and Files
Prepare the New Database
Copy Files and Folders
Verify File Permissions
Update database.php
Verify index.php and admin.php
Log In and Update Paths
Clear Caches
As suggested by Bitmanic, a dynamic config.php file helps with moving environments tremendously. Check out Leevi Graham's Config Bootstrap for a quick and simple solution. This is helpful for dev/staging/prod environments too!
I'd say the answer is the same as any other system -- export your entire database, and download all of your files (both system and anything uploaded by users - images, etc). Then, mirror this process by importing/uploading to the new server.
Before I run my export, I like to use the Deeploy Helper module to change all of my file paths in EE to the new server's settings.
Preventing data loss primarily revolves around the database and upload directories.
Does your website allow users to interact with the database? If so at some point you'll need to turn off EE to prevent DB changes. If not that you don't have too much to worry about as you can track and changes on the database end between the old and new servers.
Both Philip and Derek offer good advice for migrating EE. I've also found that having a bootstrap config file helps tremendously - especially since you can configure your file upload directories directly via config values now (as of EE2.4, I think).
For related information, please check out the answers to this similar Stack Overflow question.

Is there a file-based equivalent to .htaccess in IIS6? (not config/plugin)

There are lots of similar questions to this, but they all seem to involve either configuring permissions or installing a plugin.
I'm looking for a solution that is "dumb" - i.e. to allow the code to be deployed from source control and automatically have access to certain paths blocked, without anyone needing to configure the server.
I only need directory & file blocking, none of the other abilities that .htaccess has.
Just to be clear, we are using ColdFusion, not .NET, and whilst CF has assorted ways to handle its own scripts, it doesn't do anything with non-CFML scripts. (It is possible to do, for example config.xml.cfm, but that is a messy solution that requires updating code, etc.)
(Of course, ideally these directories/files shouldn't even be in the webroot, and if I could switch to Apache or IIS7 I could simply use .htaccess, but those aren't options at the moment.)
My current solution is going to be a readme.deploy.txt that contains instructions on how to manually set the permissions on the relevant files & directories in IIS Manager, but obviously I'd much prefer to avoid human intervention for it - any suggestions?
You could create a script that would do this when you cycle through your deployment, like say a scheduled task where you use a PowerShell script or batch script that sets up the enviroment.
With IIS6 this is going to require mucking with the Metabase, which could solve your problem, but it will require scripts to have access to the system metabase and execute system commands or you going to have to learn how to use the ii6 metabase command files
see this This Article
If they have root access maybe it would be wise to just create a installation utility that can tweak the settings for them.
Good luck,
mike
Well, for ASP.net specifically you have the .config files which allow you to control some aspect of those web folders.
However, I'm not aware of anything like .htaccess for IIS.
.NET has Routing which allows you to 'rewrite' paths. The MVC framework has it built in... I'm not sure on how to configure/use it for 'normal' ASP.NET applications.
Update: didn't know you weren't on .NET.
Maybe you're just looking for File/Folder permission settings? Don't know anything about setting those by using a config file...

Resources