Cannot run scripts using VirtualBox with Ubuntu installed - linux

I'm doing a tutorial through lydna.com on setting up linux using virtualbox.
It was going fine until I had to create a file in my development folder. It's been set up as a shared folder so I can write html files straight on to the virtual server (I think).
I'm writing small scripts in to the shared folder and I'm getting a 404 error for each. For something like http://sandbox.dev:8080/errors.php or http://sandbox.dev:8080/hello.html (with just a 'hello world' in there).
Additional Info;
In VirtualBox if I go settings->shared folders->machine folders, my 'sandbox' folder is definitely the one being used.
When I go to http://sandbox.dev:8080/server-status - it works as expected. Information about the server.
I have installed Ubuntu 14.04 LTS. I've installed a lot of packages. Things started going wrong on the 'Configuring the Apache web server' section so maybe it's an apache problem.
I have looked on the server through the command line at /var/www/html. It's looks nothing like the shared folder. Just one index.html which - when looking at it in nano - tells me it's the default ubuntu homepage. But I cannot navigate to it in the URL at all.
Can someone help?

Update apache2.conf by adding directory directive similar but according to your folder's path:
<Directory /mnt/hgfs/sandbox"
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
My confusion was similar to yours - the link sandbox.dev/server-status works, so why not anything else.
By the way I am having this issue because I am adjusting the Jon Peck's instructions to VMware Fusion and Workstation. On VM Workstation no problems what so ever, but my preferred dev environment is on OS X and there VM Fusion (Pro 7.0.1) behave different from its Windows sister - the line .host:/ in the file /etc/fstab doesn't have effect where the share folder sandbox is - it goes by default under /mnt/hgfs.
I gave up adjusting VM Fusion - even open-vm-tools could not help, so will follow Jon Peck's instructions to the letter with VirtualBox and I can share with you if I will have that issue.

Related

Can't find the /var/www/test/ directory (Mac OSX)

I'm learning python and now I arrived at 'The web' where I'm told about Apache. They ask me to create a simple file (see below) and save it as /var/www/test/home.wsgi but I can't find a directory like this and don't understand what I have to do here.
I looked for the directory but can't find it, then I started searching on google but can't find the solution.
import bottle
application = bottle.default_app()
#bottle.route('/')
def home():
return "apache and wsgi, sitting in a tree"
Anyone got any idea of what to do here?
/var/www/ is typically the root folder used by Apache for its hosted files. If it doesn't exist on your system, chances are you do not have Apache installed or have it configured to use a different folder.
On my Macbook I was able to track down this folder by checking the DocumentRoot setting in /etc/apache2/httpd.conf.
Not sure what you are trying to do in the grand scheme of things but chances are you will have to configure Apache properly before being able to visit files in your root folder through http://localhost/.

How do I create a new project in Neos CMS?

I recently turned a computer into a Ubuntu server. I have installed all dependencies following the article below http://neos.readthedocs.io/en/stable/GettingStarted/Installation.html
My version of Ubuntu (or Apache) did not have a "htdocs" folder like the previous article suggested, so I created a folder called newsletter in var/www/html per this article https://askubuntu.com/questions/683953/where-is-apache-web-root-directory-on-ubuntu
Then I try to complete step 2 of "Fundamental Instruction" by using the following code
cd /your/htdocs/
php /path/to/composer.phar create-project neos/neos-base-distribution Neos
but it does not work.
Instead of inputting "cd /your/htdocs" I navigate to /var/www/html
I am getting "Could not open input file: /path/to/composer.phar"
I believe I already have composer installed, so I don't really want to have to go through https://www.digitalocean.com/community/tutorials/how-to-install-and-use-composer-on-ubuntu-16-04
Should I change "/path/to/composer.phar"? Has the location changed?
It look like your composer is not in the given path /path/to/composer.phar
composer is not included in a bare bone Ubuntu, so you should have to follow the setup. If you want to test Neos, check https://bitnami.com/stack/neos
Should I change "/path/to/composer.phar"? Has the location changed?
This path is just an example.

Spring Tool Suite 3.8.2 - Installation on Ubuntu

I managed to install STS 3.8.2 on Ubuntu 16.04 - with a lot of hacking experiments. I have it working, but I am not happy with my solution.
Here is what I had to do:
Extracted the tar file into /opt/sts-bundle.
If you put it anywhere else, like /opt/sts, the TC server fails to start from STS.
With files in /opt/sts-bundle, TC server still fails to start from STS - permission errors. To get it to work you need to futz around with permissions of the pivotal-c-server subdirectories, essentially you need to open it up your group (the same one running STS) (security hole ?).
A local install in your own ~/sts-bundle fails on "files not found" while attempting to backup - all the conf files. It still looks in /opt/sts-bundle for all these config files (just to copy them to /backup). You can change the top directory of the server in STS server properties - but it still looks in /opt/sts-bundle. Seems hard-coded - don't know where. So you have to create all the config files in the conf directory in the tree rooted at /opt/sts-bundle ("touch" works - creating empty files). TC Server still fails to start with a "failed to clean" error - with no clue from the detailed message what files are being "cleaned".
I tried creating a non-privileged user "tcserver" per suggestion from the Pivotal TC Server docs. I installed to /opt/sts-bundle, while logged in as tcserver (with sudo privileges). That fails when I am using STS as a regular developer that is not "tcserver". Could not figure out how to tell TC server to run under a different user than the one that started STS.
The solution I have working and I am not happy with, starts by extracting the tar.gz file into /opt/sts-bundle, as it wants. Then changing owner and group of sts-bundle to my id and my group (same ones that are used in STS UI). I am not happy with that. It seems wrong to put things in /opt that are owned by a single developer.
I am new to Linux, and I still have some Windows habits that need to be unlearned.
The question is: how do I get the clean solution (installing using a "tcserver" user in the global /opt directory) to work for developers who are not "tcserver"? How should the tcserver user be related to the developers (same group?).
Am I making this problem harder than it should be? What am I missing?
I'm not sure this what you want, but I don't install the STS bundles in some kind of shared directory as a special user at all. I just install it in my user.home dir, as myself, and launch it from there.
It is very unsophisticated. I just download the tar.gz file, unpack it in my home dir and then launch it from a trivial bash script which looks something like this:
#!/bin/bash
/home/kdvolder/Applications/sts-bundle/sts-*/STS
That script is on my PATH. So I can just type 'STS' in a terminal and STS will start.
I don't have to do anything else and it works.
If you are trying to somehow install this so that several different users can run a shared installation then this isn't a good setup. But I think for your own personal laptop or desktop which only you are using, this simple setup is perfectly fine.
For a shared-user env, unfortunately, I don't know how to help you. It could be complicated to sort out all the permissions issues etc because Eclipse is a complicated beast w.r.t to installation of plugins etc.

Drupal 7 Install on Redhat w/ Apache - sites/default/files is not writable

I have spent numerous hours on an issue that has left me puzzled. I am attempting to install Drupal on Linux Redhat using apache, but it will not allow me to pass step 3 due to the fact that sites/default/files is not writable.
I have followed the instructions on Drupal's site, in their install.txt file as well as the instructions of others who have had the same error with no success.
I have granted permissions access all different ways root:root 777, root:apache 777, I have verified that apache is the user running the apache process and I am still stuck.
Note: I was able to complete the install on windows.
Any new ideas?
Okay, so after following directions from both official and non-official web sources, the one thing that was never instructed to do or try was to reboot the application AFTER making permission changes to the files directory. I tried it, and this solved the issue.
This is weird because I've never had to reboot an OS after making permission changes on a directory. Additionally I did restart httpd after each change thinking that would be sufficient. Hopefully this can help anyone else running Redhat 7 with the same issue.
Thanks, TH
I solved this problem by changing the security context of the directory "sites".
My Drupal core files are in: /var/www/html/drupal
Then I applied the command:
chcon -R -t httpd_sys_content_rw_t /var/www/html/drupal/sites/

How to import laravel project from windows to linux?

I've a created a Laravel project on my Windows environment which is worrking fine.. Now I have to move this project to Linux environment. I've tried the following methods but failed.
Method1:. Created a new project on Linux using composer create-project laravel/laravel and replaced app directory with local instance app directory
Method2. Moved entire project from windows to Linux (through FTP).
In both the above methods I failed to access my URLs. I'm sure that everything installed correctly on Linux machine.
When I access my the project on Linux /public I could see the success screen You've arrived.
But when I access my view pages like public/users/login. I'm getting Page Not Found error. The same path working fine under my windows.
What could be the wrong. I'm newbie in Laravel. Any help would be much appreciated.
If the route works with /public/index.php/users/login (and it does, see comments) it means something with the .htaccess URL rewriting isn't working properly.
These are the things you can check:
public/.htaccess should be this
.htaccess has to be enabled on the server Tutorial

Resources