Zend framework 3 change document root no Vhost access - zend-framework

I'm installing a zend 3 skeleton application on a cloudserver, but i can't change the apache Vhost. How to change the document root to the public folder?

Can you create files in the host?
Also, the FollowSymLinks option must be enabled in the Apache config to make it work.
If this is the case, you could create a symlink with the same name as the folder used today as the document root pointing to the location you wish to use as the new root.
Example:
Actual Webroot: /var/www/app
Rename your actual doc: mv /var/www/app /var/www/my_app
Create symlink: ln -s /var/www/my_app/public /var/www/app
Restart apache: service apache2 restart
With my knowledge that's the only way without access to apache configuration, unfortunately.

Related

Moving tftpboot folder

Ok, so I am trying to move the /var/lib/tftpboot folder the "proper" way to a dedicated partition. To accomplish this goal I have setup a separate partition called /app and moved the tftpboot folder there.
Issue 1: Symlink
After I moved the folder I created a symlink from the new directory to the old directory using the ln -s /app/tftpboot /var/lib/ command. After doing this I am unable to successfully restart the service using systemctl restart tftp. However, if I just update the path listed in the service file and the config file the service boots fine.

Sinatra app being run by user 'nobody' in shared folder on VM

I have a folder on my host OS (Windows 8.1) which is set up as a shared folder with VirtualBox (running Ubuntu 14.04 Server). The shared folder is set up correctly, but is giving me problems regarding permissions when I try to run apps which are inside of it.
All the files in the shared folder are owned by root and the group vboxsf. I have added my current user and the Apache user to the vboxsf group using the following commands:
sudo adduser cornflakes24 vboxsf
sudo adduser www-data vboxsf
However, when I visit my web browser to test the app, I am greeted with the following error:
This web application process is being run as user 'nobody' and group
'nogroup' and must be able to access its application root directory
'/var/www/html/webdev/ruby'. However, the parent directory
'/var/www/html/webdev' has wrong permissions, thereby preventing this
process from accessing its application root directory. Please fix the
permissions of the directory '/var/www/html/webdev' first.
The webdev folder in reference above is actually a symlink:
lrwxrwxrwx cornflakes24 www-data webdev -> /media/sf_webdev.
How can I get around this?

Can't create working meteor.js project on a vagrant box

I cannot start up a new Meteor application on a Vagrant linux box (running on a Mac). It fails every time with a 'unspecified uncaught exception' in Mongo. I have tried a bunch of things to get this going, but even with the simplest set-up, I cannot get the project running. I would be grateful for any suggestions.
My steps are:
create a completely clean Vagrant box ("ubuntu/trusty64");
install Meteor on the new box (curl https://install.meteor.com/ | sh);
choose a location to create the project;
create a new Meteor project (meteor create app);
start up the project (cd app; meteor)
I know that the permissions on the vagrant shared folder are quirky, so for step #3 above I have tried putting the project:
in the shared guest/host folder, /vagrant,
in a subdirectory of the Vagrant home folder (/home/vagrant),
in a subdirectory of / (with permissions set to vagrant:vagrant), and
in a subdirectory of / with permissions set to root:root, the project created with sudo meteor create app and run with sudo meteor
In all cases, I see this error:
=> Started proxy.
Unexpected mongo exit code 100. Restarting.
Unexpected mongo exit code 100. Restarting.
Unexpected mongo exit code 100. Restarting.
Can't start Mongo server.
MongoDB had an unspecified uncaught exception.
This can be caused by MongoDB being unable to write to a local database.
Check that you have permissions to write to .meteor/local. MongoDB does
not support filesystems like NFS that do not allow file locking.
I cannot tell if this is a Vagrant issue (though I think not, given what I've tried) or a Meteor issue, but I suspect it is Meteor (or one of its many dependencies). I doubt it is a permissions issue, since it failed when running as root. I've tried building meteor from scratch and the build fails and I've tried creating the project with --release 0.9.0 and --release 0.9.2-rc1 and the download is simply killed without explanation.
(1) After step 2 'install Meteor on the new box (curl https://install.meteor.com/ | sh)'
user$ cd /vagrant
user:/vagrant$ meteor create myApp
You should see the myApp folder on your Mac host (the same folder for the vagrantfile)
(2) Insides the myApp folder, you will see the default .meteor folder, make a folder called local if it is no there
user:/vagrant$ cd myApp/.meteor
user:/vagrant/myApp/.meteor$ mkdir local
(3) Create the same folder structure in the /home/vagrant
user:/vagrant/myApp/.meteor$ cd ~
~$mkdir -p myApp/.meteor/local
(4) Link or mount the /vagrant/myApp/.meteor/local to /home/vagrant/myApp/.meteor/local
sudo mount --bind /home/vagrant/myApp/.meteor/local/ /vagrant/myApp/.meteor/local/
or make it permanently
echo “sudo mount --bind /home/vagrant/myApp/.meteor/local/ /vagrant/myApp/.meteor/local/” >> ~/.bashrc && source ~/.bashrc
(5) Now you can start the meteor
~$cd /vagrant/myApp
user:/vagrant/myApp$meteor
The reason why I mount the local folder rather than the <.meteor> folder is that you can still edit the files insides the <.meteor> folder on your Mac host. You can replace myApp with whatever name you want
Hope this help
I'm working with a Windows host, but maybe this will apply to your situation as well.
The only folder which causes the issue is ./meteor/local. If you relocate this with a symlink to be outside of the shared /vagrant folder you should be able to run the meteor app okay.
But, to put a symlink in the shared folder you need to enable symlinks in the VM... which requires starting Vagrant as an admin.
I put together an Vagrantfile with some scripts and instructions here:
https://github.com/ElectronVector/vagrant-meteor
I ran into similar issues trying to run meteor on windows. It seems that mongodb is not able to write in the /vagrant folder. I solved this by doing
sudo mount --bind /home/vagrant/meteorapp/.meteor/ /vagrant/meteorapp/.meteor/
(got that from https://gist.github.com/gabrielhpugliese/5855677)
Here is an answer that solved my problem. Launching meteor project from a shared folder on Debian VMware virtual machine(running on a Windows).
The issue is that mongodb can't create data files inside a shared folder, so in this case just use an existing mongodb for meteor project:
export MONGO_URL=mongodb://localhost:27017/your_db
Doing
vagrant reload --provision
solved my problem.
I think the reason might be some files got corrupted or deleted.

mongodb on ubuntu 14.04 default data/db path

I am trying to install mongodb on Ubuntu 14.04.
I am new to linux. I figured out how to install ubuntu and become su to the root as well as how to set up environment path
I am just wondering where exactly the default path suppose to be for mongodb.
should I use root and put the data/db in the root directory?
When I install the mongo db it tell me to run the sudo mongo install (don't remember exactly what the command is) it runs and installs, A mongodb folder then appears in the system where etc folder is. also there is a folder in /var/lib/mongodb.
also I have to chmod 777 for the data/db I don't think I was able to do this.
So where exactly data/db suppose to reside by default?
You should take a look at mongod.conf file.
Default working directory should be "/data/db" - if is now exist - just create is. No need to chmod 777 if you create the directory and run mongo as root user.
If you want to start mongod with other working directory - modify mongod.conf file or start mongod with --dbpath /pathtootheremptyfolder/
Please let me know if you are OK.

create service using searchd command of Sphinx

I make index on one Sphinx compatible xml document.It runs success fully.
Then i make service using searchd command.Following is command to make service
searchd --install --config "path for config file" --servicename "servicename" --port "portnumber".
If Sphinx config file is put inside Sphinx directory then service create and start successfully.
But if config file is not inside Sphinx directory then service created successfully but it can not start successfully.
Should i change something inside searchd block in config file?
According the the documentation (http://sphinxsearch.com/docs/current.html#ref-searchd) all parameters specified when creating the service is called when starting the service.
--install installs searchd as a service into the Microsoft Management Console (Control Panel / Administrative Tools / Services). Any other parameters specified on the command line, where --install is specified will also become part of the command line on future starts of the service. For example, as part of calling searchd, you will likely also need to specify the configuration file with --config, and you would do that as well as specifying --install. Once called, the usual start/stop facilities will become available via the management console, so any methods you could use for starting, stopping and restarting services would also apply to searchd. Example:
C:\WINDOWS\system32> C:\Sphinx\bin\searchd.exe --install --config C:\Sphinx\sphinx.conf
The above command means that the config file must always exist at C:\Sphinx\sphinx.conf.
If your "path for config file" exists and the service still does not start, then I would suggest creating a bug at http://sphinxsearch.com/bugs/main_page.php so it cab be resolved.
In the meantime, put the config file in the Sphinx directory where it works.
Make sure you have a log folder in the sphinx folder. If you check the searchd section of the config file, it will have an option for where the log files and pid are to be placed. If the directory does not exist, then the service will not start.