I've moved a symfony2 script from website to another one on another server
when i type ls -l to check the bundles dir and shortcut its show deferent domain name
this is example
lrwxr-xr-x 1 Jack staff 61 Feb 3 2013 cmsadmin -> /var/www/mywebsite.com/src/CMS/AdminBundle/Resources/public
lrwxr-xr-x 1 Jack staff 61 Feb 3 2013 cmsfront -> /var/www/mywebsite.com/src/CMS/FrontBundle/Resources/public
lrwxr-xr-x 1 Jack staff 64 Feb 3 2013 cmssecurity -> /var/www/mywebsite.com/src/CMS/SecurityBundle/Resources/public
how i can re-write this bundles to match the new domain name or new path's ?
for example
old domain : mywebsite.com
new domain : anotherweb.com
this bundles still has the old domain shortcuts ! any advice ?
Finally found it after spending 12 hours making research about this
1- delete this folder web/bundles .
2- execute this command app/console assets:install web
you will see something like this
Installing assets for Symfony\Bundle\FrameworkBundle into web/bundles/framework
Installing assets for CMS\AdminBundle into web/bundles/cmsadmin
Installing assets for CMS\SecurityBundle into web/bundles/cmssecurity
Installing assets for Coddict\NewsBundle into web/bundles/coddictnews
Installing assets for Coddict\ContactBundle into web/bundles/coddictcontact
Installing assets for Coddict\SliderBundle into web/bundles/coddictslider
Installing assets for Coddict\MediaBundle into web/bundles/coddictmedia
Installing assets for FOS\JsRoutingBundle into web/bundles/fosjsrouting
Installing assets for CMS\FrontBundle into web/bundles/cmsfront
Installing assets for Coddict\NewsletterBundle into web/bundles/coddictnewsletter
Installing assets for Symfony\Bundle\WebProfilerBundle into web/bundles/webprofiler
Installing assets for Sensio\Bundle\DistributionBundle into web/bundles/sensiodistribution
now you done .... new bundles created
and if you face timezone error with red message just add this code inside §AppKernel.php§ write:
public function init() {
date_default_timezone_set( 'Europe/Lisbon' );
parent::init();
}
Related
Using Drupal, we've tried to import the configuration files from the solr_api_search module. When importing them and trying to initialize the core, I see the following error (Solr 7.7.2):
Could not load conf for core testcore: Can't load schema /data/solr_data/data/testcore/conf/schema.xml: Plugin init failure for [schema.xml] fieldType \"collated_ar\": Error loading class 'solr.ICUCollationField'
This is what the inside of the solrcore.properties file looks like. I added the solr.install.dir option after some people with similar issues reported that it fixed their problem:
solr.replication.master=false
solr.replication.slave=false
solr.replication.pollInterval=00:00:60
solr.replication.masterUrl=http://localhost:8983/solr
solr.replication.confFiles=schema.xml,schema_extra_types.xml,schema_extra_fields.xml,elevate.xml,stopwords_ar.txt,synonyms_ar.txt,nouns_ar.txt,protwords_ar.txt,accents_ar.txt,stopwords_en.txt,synonyms_en.txt,protwords_en.txt,accents_en.txt,stopwords_fr.txt,synonyms_fr.txt,nouns_fr.txt,protwords_fr.txt,accents_fr.txt,stopwords_de.txt,synonyms_de.txt,nouns_de.txt,protwords_de.txt,accents_de.txt,stopwords_el.txt,synonyms_el.txt,nouns_el.txt,protwords_el.txt,accents_el.txt,stopwords_hi.txt,synonyms_hi.txt,nouns_hi.txt,protwords_hi.txt,accents_hi.txt,stopwords_it.txt,synonyms_it.txt,nouns_it.txt,protwords_it.txt,accents_it.txt,stopwords_und.txt,synonyms_und.txt,protwords_und.txt,accents_und.txt,stopwords_pl.txt,synonyms_pl.txt,nouns_pl.txt,protwords_pl.txt,accents_pl.txt,stopwords_pt-br.txt,synonyms_pt-br.txt,nouns_pt-br.txt,protwords_pt-br.txt,accents_pt-br.txt,stopwords_ru.txt,synonyms_ru.txt,nouns_ru.txt,protwords_ru.txt,accents_ru.txt,stopwords_es.txt,synonyms_es.txt,nouns_es.txt,protwords_es.txt,accents_es.txt,stopwords_tr.txt,synonyms_tr.txt,nouns_tr.txt,protwords_tr.txt,accents_tr.txt
solr.luceneMatchVersion=7.7
solr.install.dir=/opt/solr
This is the process running with ps -ef:
java -server -Xms512m -Xmx512m -XX:NewRatio=3 -XX:SurvivorRatio=4 -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=8 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:ConcGCThreads=4 -XX:ParallelGCThreads=4 -XX:+CMSScavengeBeforeRemark -XX:PretenureSizeThreshold=64m -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=50 -XX:CMSMaxAbortablePrecleanTime=6000 -XX:+CMSParallelRemarkEnabled -XX:+ParallelRefProcEnabled -verbose:gc -XX:+PrintHeapAtGC -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime -Xloggc:/data/solr_data/logs/solr_gc.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=9 -XX:GCLogFileSize=20M -Dsolr.log.dir=/data/solr_data/logs -Djetty.port=8983 -DSTOP.PORT=7983 -DSTOP.KEY=solrrocks -Duser.timezone=UTC -Djetty.home=/opt/solr/server -Dsolr.solr.home=/data/solr_data/data -Dsolr.data.home= -Dsolr.install.dir=/opt/solr -Dsolr.default.confdir=/opt/solr/server/solr/configsets/_default/conf -Dlog4j.configurationFile=file:/data/solr_data/log4j.properties -Xss256k -Xss256k -Dsolr.jetty.https.port=8983 -Dsolr.log.muteconsole -XX:OnOutOfMemoryError=/opt/solr/bin/oom_solr.sh 8983 /data/solr_data/logs -jar start.jar --module=http
I have the following libraries inside of /opt/solr/contrib/analysis-extras/lib
-rw-r--r--. 1 solr solr 12370975 Jun 20 2018 icu4j-62.1.jar
-rw-r--r--. 1 solr solr 20140 Feb 18 2018 morfologik-fsa-2.1.5.jar
-rw-r--r--. 1 solr solr 1886867 Feb 18 2018 morfologik-polish-2.1.5.jar
-rw-r--r--. 1 solr solr 53644 Feb 18 2018 morfologik-stemming-2.1.5.jar
-rw-r--r--. 1 solr solr 1245779 Jun 29 2018 opennlp-tools-1.9.0.jar
Is there some option that I am missing in order to get Solr to load the .jar files?
SOlr requires different features that require an optional libraries. All of these are comes with Solr. You need to adjust solr.install.dir like already mentioned in file named INSTALL.md
Updating path to solr.install.dir=/opt/solr in solrcore.properties to fix the issue.
Check the jar named as "icu4j-62.1.jar". Check the path of the same is mentioned in solrConfig.xml and check it the lib is getting loaded.
I moved from using Docksal to Acquia ADS (Lando) which automatically upgraded my Drush from 8 to 9. My local site works fine but I can't get Drush 9 to "see" my Drupal 8 site. The aliases seem to have been created and added to the drush/sites folder and running drush site:alias does show them. However running drush status shows my Drupal root as /app. My Drupal root is /app/docroot. My alias files do have this as their root (for local). I'm not sure why Drush doesn't use the alias files it knows about. I've tried:
drush #self(or #local) list and I get some commands and this statement at the end:
[NOTE] Drupal root not found. Pass --root or a #siteAlias in order to see Drupal-specific commands.
Doing drush #local(or #self) cr returns:
In BootstrapHook.php line 32: Bootstrap failed. Run your command
with -vvv for more information.
With -vvv:
Exception trace: at
/app/vendor/drush/drush/src/Boot/BootstrapHook.php:32
Drush\Boot\BootstrapHook->initialize() at
/app/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/InitializeHookDispatcher.php:34
Consolidation\AnnotatedCommand\Hooks\Dispatchers\InitializeHookDispatcher->callInitializeHook()
at
/app/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/InitializeHookDispatcher.php:27
Consolidation\AnnotatedCommand\Hooks\Dispatchers\InitializeHookDispatcher->initialize()
at
/app/vendor/consolidation/annotated-command/src/CommandProcessor.php:145
Consolidation\AnnotatedCommand\CommandProcessor->initializeHook() at
/app/vendor/consolidation/annotated-command/src/AnnotatedCommand.php:289
Consolidation\AnnotatedCommand\AnnotatedCommand->initialize() at
/app/vendor/symfony/console/Command/Command.php:221
Symfony\Component\Console\Command\Command->run() at
/app/vendor/symfony/console/Application.php:1005
Symfony\Component\Console\Application->doRunCommand() at
/app/vendor/symfony/console/Application.php:255
Symfony\Component\Console\Application->doRun() at
/app/vendor/symfony/console/Application.php:148
Symfony\Component\Console\Application->run() at
/app/vendor/drush/drush/src/Runtime/Runtime.php:118
Drush\Runtime\Runtime->doRun() at
/app/vendor/drush/drush/src/Runtime/Runtime.php:49
Drush\Runtime\Runtime->run() at /app/vendor/drush/drush/drush.php:72
require() at /app/vendor/drush/drush/drush:4
drush status:
PHP binary : /usr/local/bin/php
PHP config :
PHP OS : Linux
Drush script : /app/vendor/drush/drush/drush
Drush version : 10.2.2 <-- Had 9.0.0 but currently trying 10, same issue
Drush temp : /tmp
Drush configs : /root/.drush/drush.yml
/app/vendor/drush/drush/drush.yml
/app/drush/drush.yml
Drupal root : /app
self.site.yml:
local:
root: /app/docroot
uri: example.lndo.site
Can someone please point me in the right direction?
Figured it out. No matter how many ways you try to tell Drush where to look to find your Drupal root, none of it will matter until you edit your composer.json file. Turns out the key to making Drush 9+ work is changing the name in composer.
My composer.json file name went from:
"name": "drupal/drupal",
to:
"name": "drupal-composer/drupal-project",
I don't think this feature was documented anywhere so I'm posting it here in response to my own question in case this helps anyone else.
I realize that this is an older question, however with Drupal 8 recently reaching end of life, and the high probability of many people (like myself) scrambling to upgrade now that clients have realized the risks of using EOL software, I want to take a moment to explain why #r00t's answer works.
r00t is correct that changing the "name" value in composer.json fixed the issue, however, the value that is set is not limited to drupal-composer/drupal-project. This seems to stem from the package webflo/drupal-finder and the way it works.
webflow/drupal-finder is a requirement of drush/drush, so it's going to be included even if you haven't added it manually. It's also a requirement of a couple of others that you may or may not have installed, like palantirnet/drupal-rector (which as a side note, is really helpful for this upgrade).
Within the code for drupal-finder is a method that looks for the install path of Drupal core based on a few items within your composer.json file.
Here is the code from DrupalFinder::isValidRoot()
foreach ($json['extra']['installer-paths'] as $install_path => $items) {
if (in_array('type:drupal-core', $items) ||
in_array('drupal/core', $items) ||
in_array('drupal/drupal', $items)) {
$this->composerRoot = $path;
// #todo: Remove this magic and detect the major version instead.
if (($install_path == 'core') || ((isset($json['name'])) && ($json['name'] == 'drupal/drupal'))) {
$install_path = '';
} elseif (substr($install_path, -5) == '/core') {
$install_path = substr($install_path, 0, -5);
}
....
Which is telling drupal-finder that if the "name" value is drupal/drupal then the install path of the site is at the base of the project, however if it is not drupal/drupal then use a value from extra.installer-paths to find the site install.
I'm still not aware if this is documented anywhere on either webflo/drupal-finder or in drush/drush, but understanding why it was an issue helped me out tremendously.
TL;DR:
If your site's docroot lives next to your vendor folder, change the name in composer.json to anything that isn't drupal/drupal. If your vendor folder lives inside your docroot, drupal/drupal will work for you.
I received a project and I'm trying to start it in Docker with NGINX environment. But it seems I have a bug with LiipImagine. The project use Symfony 4 and LIIPImagine version 2.0.x-dev.
A page should display images from cache, exemple of an image URL :
https://localhost:8443/media/cache/live_feed_message/images/live_feed_message/5c486df1a78fe_lama-750389_960_720.jpg
The directory exists with rights :
drwxr-xr-x 2 1000 1000 4069 Jan 23 13:35 live_feed_message
All images are stored in public/images/live_feed_mesage/ and in public/media/cache/live_feed_message/images/live_feed_message the corresponding image doesn't exists.
I figured out that if I use the command from LiipImagine:
php app/console liip:imagine:cache:resolve relative/path/to/image1.jpg
It gives this result :
http://localhost/media/cache/quizz_thumbnail/images/live_feed_message/name_file.jpg
http://localhost/media/cache/quizz_sponsors_icon/images/live_feed_message/name_file.jpg
http://localhost/media/cache/live_feed_message/images/live_feed_message/name_file.jpg
And then the corresponding image exists in cache (public/media/cache/live_feed_message/images/live_feed_message) and the image displays correctly on the page...
In network tab from development console, I checked the response from an HTTP request. And I get this Symfony response:
Unable to write to the "/srv/api/public/media/cache/live_feed_message/images/live_feed_message" directory.
Does someone know what could be the issue ?
Since 2 days I can't resolve this issue, so thanks for your help !
PS: I overrided a route from routing.yaml from the bundle.
In the path there was /resolve and I overrided with this (in fact I deleted /resolve from liip_imagine_filter path):
_liip_imagine:
resource: "#LiipImagineBundle/Resources/config/routing.yaml"
liip_imagine_filter:
path: /media/cache/{filter}/{path}
defaults:
_controller: '%liip_imagine.controller.filter_action%'
methods:
- GET
requirements:
filter: '[A-z0-9_-]*'
path: .+
You should maybe try being more permissive with chmod -R 777 public/images. In local it's not a very big deal, it's in production that you should fine tune your permissions. That would probably clear out your errors and you could go on coding.
An actual permission for production would be 755 IIRC.
We're running nexus on some old hardware which is limited in disk space and would like to remove artifacts older than a certain threshold.
Is there any way to do this other than a combination of find and curl?
There is a scheduled task that can automatically remove old snapshot releases:
http://www.sonatype.com/people/2009/09/nexus-scheduled-tasks/
http://www.sonatype.com/books/nexus-book/reference/confignx-sect-managing-tasks.html
Unfortunately, this does not work for hosted release repositories.
As mentioned on a Sonatype blog post linked from a comment in the blog in gavenkoa's answer, since Nexus 2.5 there is a built in "Remove Releases From Repository" scheduled task which can be configured to delete old releases keeping a defined number.
This is sufficient to meet our needs.
Delete all files to which no one access more then 100 days and not modified more then 200 days:
find . -type f -atime +100 -mtime 200 -delete
To cleanup empty directories:
find . -type d -empty -delete
Or alternatively look to https://github.com/akquinet/nexus_cleaner/blob/master/nexus_clean.sh and corresponding blog entry http://blog.akquinet.de/2013/12/09/how-to-clean-your-nexus-release-repositories/ (delete all except last 10 releases).
auto purge older than 30 days(u can change it) not download docker images from nexus 3
https://gist.github.com/anjia0532/4a7fee95fd28d17f67412f48695bb6de
# nexus3's username and pwd
username = 'admin'
password = 'admin123'
# nexus host
nexusHost = 'http://localhost:8081'
# purge repo
repoName = 'docker'
# older than days
days = 30
#change and run it
For Nexus2, you can use my Spring Boot application https://github.com/vernetto/nexusclean , you can define rules based on date and on a minimum number of Artifacts to retain, and it generates "rm -rf" commands (using the REST API is damn slow).
For Nexus3, I would definitely use a Groovy script as a "Execute Admin Task". One is posted here groovy script to delete artifacts on nexus 3 (not nexus 2)
I'm trying to do my first steps with CakePHP 2 console with Leopard and XAMPP but I get many problems which are not clear to me.
In the CakePHP 2.0 guide is written i need to setup correctly /app/Config/database.php to be sure it works, then I've tested it with an user registration and everything works.
Then I've read I can call the command via shell:
$ cake schema create DbAcl
This doesn't work because I must write the right path to the console app, then:
$ /Users/username/.../site.com/lib/Cake/Console/cake schema create DbAcl
After did that I get this error:
Welcome to CakePHP v2.0.4 Console
---------------------------------------------------------------
App : username
Path: /Users/username/
---------------------------------------------------------------
Cake Schema Shell
---------------------------------------------------------------
/Users/username/Config/Schema/db_acl.php could not be loaded
iMac-Name:~ username$
My CakePHP installation is located in the folder site.com:
site.com/app
site.com/lib
site.com/plugins
site.com/vendors
site.com/etc.
So I did this to change the CakePHP folder to the installation folder named site.com
$ /Users/username/.../site.com/lib/Cake/Console/cake -app /Users/.../site.com
Now I get this message:
Welcome to CakePHP v2.0.4 Console
---------------------------------------------------------------
App : site.com
Path: /Users/.../public_html/site.com/
---------------------------------------------------------------
Current Paths:
-app: site.com
-working: /Users/.../site.com
-root: /Users/.../public_html
-core: /Users/.../site.com/lib
Now if I write
$ /Users/username/.../site.com/lib/Cake/Console/cake schema create DbAcl
I get the wrong original path again with a different error:
Welcome to CakePHP v2.0.4 Console
---------------------------------------------------------------
App : username
Path: /Users/username/
---------------------------------------------------------------
Cake Schema Shell
---------------------------------------------------------------
/Users/username/Config/Schema/db_acl.php could not be loaded
How can I fix the path correctly?
strange thing, if I set user folder first, it works correctly:
$ cd folder/webserver/public_html/cake-app-folder
$ sudo lib/Cake/Console/cake schema DbAcl
in this way it works perfect
The real reason why many people that want to use Cakephp ACL system face this problem is that they ignore the right position where they should be before execute this command.
If you notice the error message, it says : "/Users/username/Config/Schema/db_acl.php could not be loaded".
Which is normal, actually the db_acl.php file is located in /Users/username/app/Config/Schema/db_acl.php
==> To let cakePhp fetch the file from the right place you have to be positioned in the app folder of your cake project before executing the command (cd folder/webserver/public_html/cake-app-folder in your case or c:\wamp\www\cakeTest\app for a windows project case)
Dr.Lotfi
Coopa' easy'