Laravel - CKEditor toolbar not loaded if using mysite.dev:8080 - laravel-4

CKEditor toolbar not loaded if I use mysite.dev:8080 . But its loaded in localhost/mysite/public
I put CKEditor in mysite/vendor/ckeditor
In layout.blade.php I put CKEditor javascript and CKEditor textarea as below:
{{ Form::textarea('content',null,['class' => 'ckeditor']) }} {{
HTML::script('../vendor/ckeditor/ckeditor.js'); }}
--version used--
Laravel 4.2
CKEditor 3.6
Apache 2.4.6
--apache httpd.conf virtual host setting--
Listen 8080
NameVirtualHost mysite.dev:8080
<VirtualHost *:8080>
DocumentRoot /var/www/html/mysite/public
ServerName mysite.dev
# Other Apache config directives, logs etc.
</VirtualHost>
--etc/hosts--
127.0.0.1 localhost
127.0.0.1 mysite.dev

Ok, find workaround by my self in two different ways:
Its turn Ok if I put full path of ckeditor.js as below
{{ HTML::script('//localhost/mysite/vendor/ckeditor/ckeditor.js'); }}
Put ckeditor folder in public, and not in vendor as before (is there any security issue if I do this ?).
Still hope someone explain why laravel cant point relative path of ckeditor.js
And its not server cache, Apul Gupta.

Related

Having trouble mapping Laravel public folder with a vhost on MAMP

I've got a Laravel project called "test" running on MAMP on my mac. I've uncommented the vhosts include line in httpd.conf and included this below in the vhosts file:
<VirtualHost *:80>
DocumentRoot "/Applications/MAMP/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/Applications/MAMP/htdocs/test/public"
ServerName testapp.dev
</VirtualHost>
When I go to "testapp.dev" in my browser it just says the old
testapp.dev’s server IP address could not be found.
DNS_PROBE_FINISHED_NXDOMAIN
I'm not sure if I've missed something or what. Thanks in advance for your help! :)
(This is a repost but more clear)
So I ditched MAMP and used valet. I had some problems with that just going to localhost which was some random background apache server which I stopped and then everything worked! :)
if you are using windows edit C:\windows\system32\drivers\etc\hosts and if you are using unix edit /etc/hosts file and add this row at the end of file:
127.0.0.1 testapp.dev

setting virtualhost on xampp

I'm using two xampp applications. First xampp has default setting such port apache on 80. Second xampp, i use for a project learning that apache on 9999. I wanna make an virtualhost on second xampp. I did set on
Hosts file
127.0.0.1 localhost
127.0.0.1 helloword.com
Httpd.conf
Listen 9999
Httpd-vhosts.conf
<Virtualhost *:9999>
DocumentRoot "C:/xampp/htdocs/project/public"
ServerName helloword.com
</Virtualhost>
It is where file index.html on public folder. But, when i browse http://helloword.com, it failed to view index. Index can browsed when i type http://localhost:9999/
Where should i change that setting?
Uncomment the below line in your httpd.conf.
Include conf/extra/httpd-vhosts.conf

Apache not loading right DocumentRoot

Have got myself stuck and can't find where the problem is.
Here is what I have:
OS X El Capitan
$ apachectl -v
Server version: Apache/2.4.18 (Unix)
My /etc/hosts files:
127.0.0.1 first.loc
127.0.0.1 second.loc
/etc/apache2/extra/httpd-vhost.conf
<VirtualHost *:80>
DocumentRoot "/Users/me/projects/first"
ServerName first.loc
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/Users/me/projects/second"
ServerName second.loc
</VirtualHost>
I have put 3 index.html files with their directories as the only text in them:
/Users/me/projects/index.html (1)
/Users/me/projects/first/index.html (2)
/Users/me/projects/second/index.html (3)
When I go to first.loc or second.loc it loads the projects/index.html.
When I go to first.loc/first it loads the second index.html, when I go to first.loc/second it loads the 3rd.
Why are the DocumentRoots not being processed correctly?
Solved and answered below: Web Sharing panel was stopping Apache being restarted fully so it wasn't actually reloading the config files. Turning that off and manually starting/stopping/restarting has resolved.
Ok it seems the problem has 'fixed' itself. The issue was not with Apache but with sudo apachectl restart not working properly.
I previously installed a Web Sharing panel to try out which was set to 'On'. With that set, it seems to stop all the apache processes from stopping so it never truly stops and restarts with the updated config files.
Have removed the silly panel and now starting and stopping manually and it's all working as it should!

Cant use MAMP when laravel installed?

I have MAMP installed which is fine. One of the project is Laravel. My laravel project is placed like this:
MAMP/htdocs/LaraBlog/laravel
but then i just want a normal PHP project on my mamp server aswell. I have placed it like this:
MAMP/htdocs/notes
But when i go to
http://localhost:8888/notes it tries to find a laravel route? i havent a artisan serve running. What is wrong?
Then you probably have only created one host that points to..
MAMP/htdocs/LaraBlog/laravel/public
If you have MAMP Pro you can just create another host like larablog.dev that points to..
MAMP/htdocs/LaraBlog/laravel/public
and for "normal" PHP work you can use localhost.
If you do not have MAMP Pro open that file..
MAMP/conf/apache/extra/httpd-vhosts.conf
At the end of that file you can do something like that..
<VirtualHost *>
DocumentRoot "/Applications/MAMP/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *>
DocumentRoot "/Applications/MAMP/htdocs/LaraBlog/laravel/public"
ServerName larablog.dev
</VirtualHost>
Then you need to update your hosts file.
Open you Terminal and run this command..
sudo nano /etc/hosts
and put this at the end..
127.0.0.1 larablog.dev
Now restart MAMP and you can access larablog.dev for your Laravel application and localhost for the other things.

Apache 2.2 localhost VirtualHosts problems

I am trying to setup my dev machine with virtual hosts so I can access my development projects with a simple url, like http:// project.dev/ rather that a whole http:// 127.0.0.1/dev/path/to/root/of/project/ type of url.
Now, I'm aware there are many tutorials and questions already answered about this, but after trying many of them, I feel like I'm running in circles here.
The problem is simple: after setting up my hosts file and my virtual hosts, any attempt to access a virtual hosts irremediably displays the content of my server DocumentRoot.
my hosts file:
127.0.0.1 localhost
127.0.0.1 mydomain.dev
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
my httpd-vhosts.conf
NameVirtualHost *:80
<VirtualHost *:80>
ServerName localhost
DocumentRoot /Users/pilot/Sites/
</Virtualhost>
<VirtualHost *:80>
ServerName mydomain.dev
DocumentRoot /Users/pilot/Sites/devel/vytamin/dev/
</VirtualHost>
I precise that the httpd-vhosts.conf file IS loaded in my httpd.conf and I do get a warning if I point the virtual host document root to a wrong folder.
I made a try setting the localhost virtual host to the following, without any success.
<VirtualHost *:80>
ServerName localhost
DocumentRoot /Users/pilot/Sites/devel
</Virtualhost>
The following URLS all display the DocumentRoot of my server defined in my httpd.conf file, and seem to ignore the DocumentRoot defined in my VirtualHosts.
http:// 127.0.0.1/
http:// localhost/
http:// mydomain.dev/
I'm running Apache2.2 on Mac OSX 10.5 Leopard, but not the one shipped with mac os. I compiled my own under /usr/local/apache2 and web sharing IS disabled
I can't see anything wrong with my set up so I hope the community will!
Thanks for your help!
Ok, I found the problem!
The configuration above is perfectly fine, it was just that my apache was not restarting properly.
Neither apache_ctl graceful or apache_ctl restart was terminating all httpd processes I have running, therefore failing to reload properly the changes in my configuration files.
Once I killed the remaining processes and really restarted apache, it worked...
Solved, but I feel dumb to have found that!
Now I have a daemon situation to solve!

Resources